sublimetheme 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +230 -0
- data/Rakefile +8 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/sublimetheme.rb +6832 -0
- data/lib/sublimetheme/version.rb +3 -0
- data/path/bin/htmldiff +25 -0
- data/path/bin/htmldiff.bat +6 -0
- data/path/bin/ldiff +25 -0
- data/path/bin/ldiff.bat +6 -0
- data/path/bin/rspec +23 -0
- data/path/bin/rspec.bat +6 -0
- data/path/cache/diff-lcs-1.2.5.gem +0 -0
- data/path/cache/rspec-3.3.0.gem +0 -0
- data/path/cache/rspec-core-3.3.2.gem +0 -0
- data/path/cache/rspec-expectations-3.3.1.gem +0 -0
- data/path/cache/rspec-mocks-3.3.2.gem +0 -0
- data/path/cache/rspec-support-3.3.0.gem +0 -0
- data/path/gems/diff-lcs-1.2.5/.autotest +3 -0
- data/path/gems/diff-lcs-1.2.5/.gemtest +0 -0
- data/path/gems/diff-lcs-1.2.5/.hoerc +2 -0
- data/path/gems/diff-lcs-1.2.5/.rspec +2 -0
- data/path/gems/diff-lcs-1.2.5/.travis.yml +22 -0
- data/path/gems/diff-lcs-1.2.5/Contributing.rdoc +64 -0
- data/path/gems/diff-lcs-1.2.5/Gemfile +20 -0
- data/path/gems/diff-lcs-1.2.5/History.rdoc +152 -0
- data/path/gems/diff-lcs-1.2.5/License.rdoc +39 -0
- data/path/gems/diff-lcs-1.2.5/Manifest.txt +38 -0
- data/path/gems/diff-lcs-1.2.5/README.rdoc +85 -0
- data/path/gems/diff-lcs-1.2.5/Rakefile +41 -0
- data/path/gems/diff-lcs-1.2.5/autotest/discover.rb +1 -0
- data/path/gems/diff-lcs-1.2.5/bin/htmldiff +32 -0
- data/path/gems/diff-lcs-1.2.5/bin/ldiff +6 -0
- data/path/gems/diff-lcs-1.2.5/docs/COPYING.txt +339 -0
- data/path/gems/diff-lcs-1.2.5/docs/artistic.txt +127 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff-lcs.rb +3 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs.rb +805 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/array.rb +7 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/block.rb +37 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/callbacks.rb +322 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/change.rb +177 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/htmldiff.rb +149 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/hunk.rb +276 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/internals.rb +301 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/ldiff.rb +195 -0
- data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/string.rb +5 -0
- data/path/gems/diff-lcs-1.2.5/spec/change_spec.rb +65 -0
- data/path/gems/diff-lcs-1.2.5/spec/diff_spec.rb +47 -0
- data/path/gems/diff-lcs-1.2.5/spec/hunk_spec.rb +72 -0
- data/path/gems/diff-lcs-1.2.5/spec/issues_spec.rb +24 -0
- data/path/gems/diff-lcs-1.2.5/spec/lcs_spec.rb +54 -0
- data/path/gems/diff-lcs-1.2.5/spec/patch_spec.rb +414 -0
- data/path/gems/diff-lcs-1.2.5/spec/sdiff_spec.rb +214 -0
- data/path/gems/diff-lcs-1.2.5/spec/spec_helper.rb +290 -0
- data/path/gems/diff-lcs-1.2.5/spec/traverse_balanced_spec.rb +310 -0
- data/path/gems/diff-lcs-1.2.5/spec/traverse_sequences_spec.rb +139 -0
- data/path/gems/rspec-3.3.0/License.txt +24 -0
- data/path/gems/rspec-3.3.0/README.md +34 -0
- data/path/gems/rspec-3.3.0/lib/rspec.rb +3 -0
- data/path/gems/rspec-3.3.0/lib/rspec/version.rb +5 -0
- data/path/gems/rspec-core-3.3.2/.document +5 -0
- data/path/gems/rspec-core-3.3.2/.yardopts +8 -0
- data/path/gems/rspec-core-3.3.2/Changelog.md +1856 -0
- data/path/gems/rspec-core-3.3.2/License.txt +25 -0
- data/path/gems/rspec-core-3.3.2/README.md +369 -0
- data/path/gems/rspec-core-3.3.2/exe/rspec +4 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/autorun.rb +3 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core.rb +181 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/backtrace_formatter.rb +64 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/coordinator.rb +66 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/example_minimizer.rb +130 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/runner.rb +139 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/server.rb +61 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/subset_enumerator.rb +39 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb +1807 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/configuration_options.rb +191 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/drb.rb +111 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/dsl.rb +96 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/example.rb +573 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb +796 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/example_status_persister.rb +235 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/filter_manager.rb +231 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/flat_map.rb +20 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters.rb +254 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/base_formatter.rb +70 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/base_text_formatter.rb +77 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/bisect_formatter.rb +68 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/bisect_progress_formatter.rb +115 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/console_codes.rb +65 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/documentation_formatter.rb +70 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/exception_presenter.rb +393 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/helpers.rb +109 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/html_formatter.rb +151 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/html_printer.rb +415 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/json_formatter.rb +96 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/profile_formatter.rb +68 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/progress_formatter.rb +28 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/protocol.rb +172 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/snippet_extractor.rb +116 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb +638 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/memoized_helpers.rb +532 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/metadata.rb +490 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/metadata_filter.rb +235 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/null.rb +14 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/rr.rb +31 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/mutex.rb +63 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/notifications.rb +498 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/option_parser.rb +301 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/ordering.rb +158 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/pending.rb +165 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/profiler.rb +32 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/project_initializer.rb +48 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/project_initializer/.rspec +2 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/project_initializer/spec/spec_helper.rb +96 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/rake_task.rb +158 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/reentrant_mutex.rb +52 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb +220 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/ruby_project.rb +53 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb +179 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/sandbox.rb +37 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/set.rb +49 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/shared_context.rb +55 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/shared_example_group.rb +210 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/shell_escape.rb +49 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/version.rb +9 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/warnings.rb +40 -0
- data/path/gems/rspec-core-3.3.2/lib/rspec/core/world.rb +178 -0
- data/path/gems/rspec-expectations-3.3.1/.document +5 -0
- data/path/gems/rspec-expectations-3.3.1/.yardopts +6 -0
- data/path/gems/rspec-expectations-3.3.1/Changelog.md +953 -0
- data/path/gems/rspec-expectations-3.3.1/License.txt +24 -0
- data/path/gems/rspec-expectations-3.3.1/README.md +289 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations.rb +81 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/configuration.rb +164 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/expectation_target.rb +113 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/fail_with.rb +31 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/failure_aggregator.rb +194 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/handler.rb +170 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/minitest_integration.rb +31 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/syntax.rb +132 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/version.rb +8 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers.rb +1009 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/aliased_matcher.rb +116 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in.rb +52 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/all.rb +85 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/base_matcher.rb +181 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be.rb +285 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_between.rb +77 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_instance_of.rb +22 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_kind_of.rb +16 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_within.rb +72 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/change.rb +337 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/compound.rb +293 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/contain_exactly.rb +253 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/cover.rb +24 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/eq.rb +40 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/eql.rb +34 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/equal.rb +81 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/exist.rb +86 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/has.rb +103 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/include.rb +130 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/match.rb +37 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/operators.rb +128 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/output.rb +200 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/raise_error.rb +216 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/respond_to.rb +90 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/satisfy.rb +37 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/start_or_end_with.rb +94 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/throw_symbol.rb +132 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/yield.rb +418 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/composable.rb +184 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/dsl.rb +453 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/english_phrasing.rb +42 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +73 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/fail_matchers.rb +42 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/generated_descriptions.rb +42 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_delegator.rb +35 -0
- data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_protocol.rb +99 -0
- data/path/gems/rspec-mocks-3.3.2/.document +5 -0
- data/path/gems/rspec-mocks-3.3.2/.yardopts +6 -0
- data/path/gems/rspec-mocks-3.3.2/Changelog.md +965 -0
- data/path/gems/rspec-mocks-3.3.2/License.txt +24 -0
- data/path/gems/rspec-mocks-3.3.2/README.md +430 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks.rb +126 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance.rb +11 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/chain.rb +110 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expect_chain_chain.rb +35 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb +48 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/message_chains.rb +83 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/proxy.rb +116 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/recorder.rb +264 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/stub_chain.rb +46 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/stub_chain_chain.rb +27 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/argument_list_matcher.rb +100 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/argument_matchers.rb +320 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/configuration.rb +188 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/error_generator.rb +362 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/example_methods.rb +421 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/instance_method_stasher.rb +135 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/marshal_extension.rb +41 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/expectation_customization.rb +20 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/have_received.rb +116 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/receive.rb +130 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/receive_message_chain.rb +80 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/receive_messages.rb +75 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/message_chain.rb +87 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/message_expectation.rb +717 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/method_double.rb +287 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/method_reference.rb +192 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/mutate_const.rb +335 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/mutex.rb +73 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/object_reference.rb +149 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/order_group.rb +81 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/proxy.rb +439 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/reentrant_mutex.rb +53 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/space.rb +238 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/standalone.rb +3 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/syntax.rb +325 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/targets.rb +97 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/test_double.rb +170 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/verifying_double.rb +129 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/verifying_message_expecation.rb +54 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/verifying_proxy.rb +213 -0
- data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/version.rb +9 -0
- data/path/gems/rspec-support-3.3.0/Changelog.md +125 -0
- data/path/gems/rspec-support-3.3.0/LICENSE.txt +22 -0
- data/path/gems/rspec-support-3.3.0/README.md +26 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support.rb +111 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/caller_filter.rb +83 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/differ.rb +215 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/directory_maker.rb +63 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/encoded_string.rb +155 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/fuzzy_matcher.rb +48 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/hunk_generator.rb +47 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/matcher_definition.rb +42 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/method_signature_verifier.rb +273 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/object_formatter.rb +93 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/recursive_const_methods.rb +76 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/ruby_features.rb +118 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec.rb +81 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/deprecation_helpers.rb +64 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/formatting_support.rb +9 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/in_sub_process.rb +52 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/library_wide_checks.rb +145 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/shell_out.rb +71 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/stderr_splitter.rb +63 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/string_matcher.rb +46 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/with_isolated_directory.rb +9 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/with_isolated_stderr.rb +13 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/version.rb +7 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/version_checker.rb +53 -0
- data/path/gems/rspec-support-3.3.0/lib/rspec/support/warnings.rb +39 -0
- data/path/specifications/diff-lcs-1.2.5.gemspec +68 -0
- data/path/specifications/rspec-3.3.0.gemspec +42 -0
- data/path/specifications/rspec-core-3.3.2.gemspec +68 -0
- data/path/specifications/rspec-expectations-3.3.1.gemspec +50 -0
- data/path/specifications/rspec-mocks-3.3.2.gemspec +53 -0
- data/path/specifications/rspec-support-3.3.0.gemspec +38 -0
- data/sublimetheme.gemspec +32 -0
- metadata +363 -0
@@ -0,0 +1,76 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Support
|
3
|
+
# Provides recursive constant lookup methods useful for
|
4
|
+
# constant stubbing.
|
5
|
+
module RecursiveConstMethods
|
6
|
+
# We only want to consider constants that are defined directly on a
|
7
|
+
# particular module, and not include top-level/inherited constants.
|
8
|
+
# Unfortunately, the constant API changed between 1.8 and 1.9, so
|
9
|
+
# we need to conditionally define methods to ignore the top-level/inherited
|
10
|
+
# constants.
|
11
|
+
#
|
12
|
+
# Given:
|
13
|
+
# class A; B = 1; end
|
14
|
+
# class C < A; end
|
15
|
+
#
|
16
|
+
# On 1.8:
|
17
|
+
# - C.const_get("Hash") # => ::Hash
|
18
|
+
# - C.const_defined?("Hash") # => false
|
19
|
+
# - C.constants # => ["B"]
|
20
|
+
# - None of these methods accept the extra `inherit` argument
|
21
|
+
# On 1.9:
|
22
|
+
# - C.const_get("Hash") # => ::Hash
|
23
|
+
# - C.const_defined?("Hash") # => true
|
24
|
+
# - C.const_get("Hash", false) # => raises NameError
|
25
|
+
# - C.const_defined?("Hash", false) # => false
|
26
|
+
# - C.constants # => [:B]
|
27
|
+
# - C.constants(false) #=> []
|
28
|
+
if Module.method(:const_defined?).arity == 1
|
29
|
+
def const_defined_on?(mod, const_name)
|
30
|
+
mod.const_defined?(const_name)
|
31
|
+
end
|
32
|
+
|
33
|
+
def get_const_defined_on(mod, const_name)
|
34
|
+
return mod.const_get(const_name) if const_defined_on?(mod, const_name)
|
35
|
+
|
36
|
+
raise NameError, "uninitialized constant #{mod.name}::#{const_name}"
|
37
|
+
end
|
38
|
+
|
39
|
+
def constants_defined_on(mod)
|
40
|
+
mod.constants.select { |c| const_defined_on?(mod, c) }
|
41
|
+
end
|
42
|
+
else
|
43
|
+
def const_defined_on?(mod, const_name)
|
44
|
+
mod.const_defined?(const_name, false)
|
45
|
+
end
|
46
|
+
|
47
|
+
def get_const_defined_on(mod, const_name)
|
48
|
+
mod.const_get(const_name, false)
|
49
|
+
end
|
50
|
+
|
51
|
+
def constants_defined_on(mod)
|
52
|
+
mod.constants(false)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def recursive_const_get(const_name)
|
57
|
+
normalize_const_name(const_name).split('::').inject(Object) do |mod, name|
|
58
|
+
get_const_defined_on(mod, name)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def recursive_const_defined?(const_name)
|
63
|
+
parts = normalize_const_name(const_name).split('::')
|
64
|
+
parts.inject([Object, '']) do |(mod, full_name), name|
|
65
|
+
yield(full_name, name) if block_given? && !(Module === mod)
|
66
|
+
return false unless const_defined_on?(mod, name)
|
67
|
+
[get_const_defined_on(mod, name), [mod, name].join('::')]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def normalize_const_name(const_name)
|
72
|
+
const_name.sub(/\A::/, '')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Support
|
5
|
+
# @api private
|
6
|
+
#
|
7
|
+
# Provides query methods for different OS or OS features.
|
8
|
+
module OS
|
9
|
+
module_function
|
10
|
+
|
11
|
+
def windows?
|
12
|
+
RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/
|
13
|
+
end
|
14
|
+
|
15
|
+
def windows_file_path?
|
16
|
+
::File::ALT_SEPARATOR == '\\'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# @api private
|
21
|
+
#
|
22
|
+
# Provides query methods for different rubies
|
23
|
+
module Ruby
|
24
|
+
module_function
|
25
|
+
|
26
|
+
def jruby?
|
27
|
+
RUBY_PLATFORM == 'java'
|
28
|
+
end
|
29
|
+
|
30
|
+
def rbx?
|
31
|
+
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
|
32
|
+
end
|
33
|
+
|
34
|
+
def non_mri?
|
35
|
+
!mri?
|
36
|
+
end
|
37
|
+
|
38
|
+
def mri?
|
39
|
+
!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# @api private
|
44
|
+
#
|
45
|
+
# Provides query methods for ruby features that differ among
|
46
|
+
# implementations.
|
47
|
+
module RubyFeatures
|
48
|
+
module_function
|
49
|
+
|
50
|
+
def optional_and_splat_args_supported?
|
51
|
+
Method.method_defined?(:parameters)
|
52
|
+
end
|
53
|
+
|
54
|
+
def caller_locations_supported?
|
55
|
+
respond_to?(:caller_locations, true)
|
56
|
+
end
|
57
|
+
|
58
|
+
if Ruby.mri?
|
59
|
+
def kw_args_supported?
|
60
|
+
RUBY_VERSION >= '2.0.0'
|
61
|
+
end
|
62
|
+
|
63
|
+
def required_kw_args_supported?
|
64
|
+
RUBY_VERSION >= '2.1.0'
|
65
|
+
end
|
66
|
+
|
67
|
+
def supports_rebinding_module_methods?
|
68
|
+
RUBY_VERSION.to_i >= 2
|
69
|
+
end
|
70
|
+
else
|
71
|
+
# RBX / JRuby et al support is unknown for keyword arguments
|
72
|
+
# rubocop:disable Lint/Eval
|
73
|
+
begin
|
74
|
+
eval("o = Object.new; def o.m(a: 1); end;"\
|
75
|
+
" raise SyntaxError unless o.method(:m).parameters.include?([:key, :a])")
|
76
|
+
|
77
|
+
def kw_args_supported?
|
78
|
+
true
|
79
|
+
end
|
80
|
+
rescue SyntaxError
|
81
|
+
def kw_args_supported?
|
82
|
+
false
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
begin
|
87
|
+
eval("o = Object.new; def o.m(a: ); end;"\
|
88
|
+
"raise SyntaxError unless o.method(:m).parameters.include?([:keyreq, :a])")
|
89
|
+
|
90
|
+
def required_kw_args_supported?
|
91
|
+
true
|
92
|
+
end
|
93
|
+
rescue SyntaxError
|
94
|
+
def required_kw_args_supported?
|
95
|
+
false
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
begin
|
100
|
+
Module.new { def foo; end }.instance_method(:foo).bind(Object.new)
|
101
|
+
|
102
|
+
def supports_rebinding_module_methods?
|
103
|
+
true
|
104
|
+
end
|
105
|
+
rescue TypeError
|
106
|
+
def supports_rebinding_module_methods?
|
107
|
+
false
|
108
|
+
end
|
109
|
+
end
|
110
|
+
# rubocop:enable Lint/Eval
|
111
|
+
end
|
112
|
+
|
113
|
+
def module_prepends_supported?
|
114
|
+
Module.method_defined?(:prepend) || Module.private_method_defined?(:prepend)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'rspec/support'
|
2
|
+
require 'rspec/support/spec/in_sub_process'
|
3
|
+
|
4
|
+
RSpec::Support.require_rspec_support "spec/deprecation_helpers"
|
5
|
+
RSpec::Support.require_rspec_support "spec/with_isolated_stderr"
|
6
|
+
RSpec::Support.require_rspec_support "spec/stderr_splitter"
|
7
|
+
RSpec::Support.require_rspec_support "spec/formatting_support"
|
8
|
+
RSpec::Support.require_rspec_support "spec/with_isolated_directory"
|
9
|
+
RSpec::Support.require_rspec_support "ruby_features"
|
10
|
+
|
11
|
+
warning_preventer = $stderr = RSpec::Support::StdErrSplitter.new($stderr)
|
12
|
+
|
13
|
+
RSpec.configure do |c|
|
14
|
+
c.include RSpecHelpers
|
15
|
+
c.include RSpec::Support::WithIsolatedStdErr
|
16
|
+
c.include RSpec::Support::FormattingSupport
|
17
|
+
c.include RSpec::Support::InSubProcess
|
18
|
+
|
19
|
+
unless defined?(Debugger) # debugger causes warnings when used
|
20
|
+
c.before do
|
21
|
+
warning_preventer.reset!
|
22
|
+
end
|
23
|
+
|
24
|
+
c.after do
|
25
|
+
warning_preventer.verify_no_warnings!
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if c.files_to_run.one?
|
30
|
+
c.full_backtrace = true
|
31
|
+
c.default_formatter = 'doc'
|
32
|
+
end
|
33
|
+
|
34
|
+
c.filter_run :focus
|
35
|
+
c.run_all_when_everything_filtered = true
|
36
|
+
c.example_status_persistence_file_path = "./spec/examples.txt"
|
37
|
+
|
38
|
+
c.define_derived_metadata :failing_on_appveyor do |meta|
|
39
|
+
meta[:pending] ||= "This spec fails on AppVeyor and needs someone to fix it."
|
40
|
+
end if ENV['APPVEYOR']
|
41
|
+
end
|
42
|
+
|
43
|
+
module RSpec
|
44
|
+
module Support
|
45
|
+
module Spec
|
46
|
+
def self.setup_simplecov(&block)
|
47
|
+
# Simplecov emits some ruby warnings when loaded, so silence them.
|
48
|
+
old_verbose, $VERBOSE = $VERBOSE, false
|
49
|
+
|
50
|
+
return if ENV['NO_COVERAGE'] || RUBY_VERSION < '1.9.3'
|
51
|
+
return if RUBY_ENGINE != 'ruby' || RSpec::Support::OS.windows?
|
52
|
+
|
53
|
+
# Don't load it when we're running a single isolated
|
54
|
+
# test file rather than the whole suite.
|
55
|
+
return if RSpec.configuration.files_to_run.one?
|
56
|
+
|
57
|
+
require 'simplecov'
|
58
|
+
start_simplecov(&block)
|
59
|
+
rescue LoadError
|
60
|
+
warn "Simplecov could not be loaded"
|
61
|
+
ensure
|
62
|
+
$VERBOSE = old_verbose
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.start_simplecov(&block)
|
66
|
+
SimpleCov.start do
|
67
|
+
add_filter "./bundle/"
|
68
|
+
add_filter "./tmp/"
|
69
|
+
add_filter do |source_file|
|
70
|
+
# Filter out `spec` directory except when it is under `lib`
|
71
|
+
# (as is the case in rspec-support)
|
72
|
+
source_file.filename.include?('/spec/') && !source_file.filename.include?('/lib/')
|
73
|
+
end
|
74
|
+
|
75
|
+
instance_eval(&block) if block
|
76
|
+
end
|
77
|
+
end
|
78
|
+
private_class_method :start_simplecov
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module RSpecHelpers
|
2
|
+
def expect_no_deprecation
|
3
|
+
expect(RSpec.configuration.reporter).not_to receive(:deprecation)
|
4
|
+
end
|
5
|
+
|
6
|
+
def expect_deprecation_with_call_site(file, line, snippet=//)
|
7
|
+
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
|
8
|
+
expect(options[:call_site]).to include([file, line].join(':'))
|
9
|
+
expect(options[:deprecated]).to match(snippet)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def expect_deprecation_without_call_site(snippet=//)
|
14
|
+
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
|
15
|
+
expect(options[:call_site]).to eq nil
|
16
|
+
expect(options[:deprecated]).to match(snippet)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def expect_warn_deprecation_with_call_site(file, line, snippet=//)
|
21
|
+
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
|
22
|
+
message = options[:message]
|
23
|
+
expect(message).to match(snippet)
|
24
|
+
expect(message).to include([file, line].join(':'))
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def expect_warn_deprecation(snippet=//)
|
29
|
+
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
|
30
|
+
message = options[:message]
|
31
|
+
expect(message).to match(snippet)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def allow_deprecation
|
36
|
+
allow(RSpec.configuration.reporter).to receive(:deprecation)
|
37
|
+
end
|
38
|
+
|
39
|
+
def expect_no_deprecations
|
40
|
+
expect(RSpec.configuration.reporter).not_to receive(:deprecation)
|
41
|
+
end
|
42
|
+
|
43
|
+
def expect_warning_without_call_site(expected=//)
|
44
|
+
expect(::Kernel).to receive(:warn) do |message|
|
45
|
+
expect(message).to match expected
|
46
|
+
expect(message).to_not match(/Called from/)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def expect_warning_with_call_site(file, line, expected=//)
|
51
|
+
expect(::Kernel).to receive(:warn) do |message|
|
52
|
+
expect(message).to match expected
|
53
|
+
expect(message).to match(/Called from #{file}:#{line}/)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def expect_no_warnings
|
58
|
+
expect(::Kernel).not_to receive(:warn)
|
59
|
+
end
|
60
|
+
|
61
|
+
def allow_warning
|
62
|
+
allow(::Kernel).to receive(:warn)
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Support
|
3
|
+
module InSubProcess
|
4
|
+
if Process.respond_to?(:fork) && !(Ruby.jruby? && RUBY_VERSION == '1.8.7')
|
5
|
+
|
6
|
+
# Useful as a way to isolate a global change to a subprocess.
|
7
|
+
|
8
|
+
# rubocop:disable MethodLength
|
9
|
+
def in_sub_process(prevent_warnings=true)
|
10
|
+
readme, writeme = IO.pipe
|
11
|
+
|
12
|
+
pid = Process.fork do
|
13
|
+
exception = nil
|
14
|
+
warning_preventer = $stderr = RSpec::Support::StdErrSplitter.new($stderr)
|
15
|
+
|
16
|
+
begin
|
17
|
+
yield
|
18
|
+
warning_preventer.verify_no_warnings! if prevent_warnings
|
19
|
+
rescue Exception => e
|
20
|
+
exception = e
|
21
|
+
end
|
22
|
+
|
23
|
+
writeme.write Marshal.dump(exception)
|
24
|
+
|
25
|
+
readme.close
|
26
|
+
writeme.close
|
27
|
+
exit! # prevent at_exit hooks from running (e.g. minitest)
|
28
|
+
end
|
29
|
+
|
30
|
+
writeme.close
|
31
|
+
Process.waitpid(pid)
|
32
|
+
|
33
|
+
exception = Marshal.load(readme.read)
|
34
|
+
readme.close
|
35
|
+
|
36
|
+
raise exception if exception
|
37
|
+
end
|
38
|
+
# rubocop:enable MethodLength
|
39
|
+
alias :in_sub_process_if_possible :in_sub_process
|
40
|
+
else
|
41
|
+
def in_sub_process(*)
|
42
|
+
skip "This spec requires forking to work properly, " \
|
43
|
+
"and your platform does not support forking"
|
44
|
+
end
|
45
|
+
|
46
|
+
def in_sub_process_if_possible(*)
|
47
|
+
yield
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
require 'rspec/support/spec/shell_out'
|
2
|
+
|
3
|
+
RSpec.shared_examples_for "library wide checks" do |lib, options|
|
4
|
+
consider_a_test_env_file = options.fetch(:consider_a_test_env_file, /MATCHES NOTHING/)
|
5
|
+
allowed_loaded_feature_regexps = options.fetch(:allowed_loaded_feature_regexps, [])
|
6
|
+
preamble_for_lib = options[:preamble_for_lib]
|
7
|
+
preamble_for_spec = "require 'rspec/core'; require 'spec_helper'"
|
8
|
+
skip_spec_files = options.fetch(:skip_spec_files, /MATCHES NOTHING/)
|
9
|
+
|
10
|
+
include RSpec::Support::ShellOut
|
11
|
+
|
12
|
+
define_method :files_to_require_for do |sub_dir|
|
13
|
+
slash = File::SEPARATOR
|
14
|
+
lib_path_re = /#{slash + lib}[^#{slash}]*#{slash}lib/
|
15
|
+
load_path = $LOAD_PATH.grep(lib_path_re).first
|
16
|
+
directory = load_path.sub(/lib$/, sub_dir)
|
17
|
+
files = Dir["#{directory}/**/*.rb"]
|
18
|
+
extract_regex = /#{Regexp.escape(directory) + File::SEPARATOR}(.+)\.rb$/
|
19
|
+
|
20
|
+
# We sort to ensure the files are loaded in a consistent order, regardless
|
21
|
+
# of OS. Otherwise, it could load in a different order on Travis than
|
22
|
+
# locally, and potentially trigger a "circular require considered harmful"
|
23
|
+
# warning or similar.
|
24
|
+
files.sort.map { |file| file[extract_regex, 1] }
|
25
|
+
end
|
26
|
+
|
27
|
+
def command_from(code_lines)
|
28
|
+
code_lines.join("\n")
|
29
|
+
end
|
30
|
+
|
31
|
+
def load_all_files(files, preamble, postamble=nil)
|
32
|
+
requires = files.map { |f| "require '#{f}'" }
|
33
|
+
command = command_from(Array(preamble) + requires + Array(postamble))
|
34
|
+
|
35
|
+
stdout, stderr, status = with_env 'NO_COVERAGE' => '1' do
|
36
|
+
options = %w[ -w ]
|
37
|
+
options << "--disable=gem" if RUBY_VERSION.to_f >= 1.9 && RSpec::Support::Ruby.mri?
|
38
|
+
run_ruby_with_current_load_path(command, *options)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Ignore bundler warning.
|
42
|
+
stderr = stderr.split("\n").reject { |l| l =~ %r{bundler/source/rubygems} }.join("\n")
|
43
|
+
[stdout, stderr, status.exitstatus]
|
44
|
+
end
|
45
|
+
|
46
|
+
define_method :load_all_lib_files do
|
47
|
+
files = all_lib_files - lib_test_env_files
|
48
|
+
preamble = ['orig_loaded_features = $".dup', preamble_for_lib]
|
49
|
+
postamble = ['puts(($" - orig_loaded_features).join("\n"))']
|
50
|
+
|
51
|
+
@loaded_feature_lines, stderr, exitstatus = load_all_files(files, preamble, postamble)
|
52
|
+
["", stderr, exitstatus]
|
53
|
+
end
|
54
|
+
|
55
|
+
define_method :load_all_spec_files do
|
56
|
+
files = files_to_require_for("spec") + lib_test_env_files
|
57
|
+
files = files.reject { |f| f =~ skip_spec_files }
|
58
|
+
load_all_files(files, preamble_for_spec)
|
59
|
+
end
|
60
|
+
|
61
|
+
attr_reader :all_lib_files, :lib_test_env_files,
|
62
|
+
:lib_file_results, :spec_file_results
|
63
|
+
|
64
|
+
before(:context) do
|
65
|
+
@all_lib_files = files_to_require_for("lib")
|
66
|
+
@lib_test_env_files = all_lib_files.grep(consider_a_test_env_file)
|
67
|
+
|
68
|
+
@lib_file_results, @spec_file_results = [
|
69
|
+
# Load them in parallel so it's faster...
|
70
|
+
Thread.new { load_all_lib_files },
|
71
|
+
Thread.new { load_all_spec_files }
|
72
|
+
].map(&:join).map(&:value)
|
73
|
+
end
|
74
|
+
|
75
|
+
def have_successful_no_warnings_output
|
76
|
+
eq ["", "", 0]
|
77
|
+
end
|
78
|
+
|
79
|
+
it "issues no warnings when loaded", :slow do
|
80
|
+
expect(lib_file_results).to have_successful_no_warnings_output
|
81
|
+
end
|
82
|
+
|
83
|
+
it "issues no warnings when the spec files are loaded", :slow do
|
84
|
+
expect(spec_file_results).to have_successful_no_warnings_output
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'only loads a known set of stdlibs so gem authors are forced ' \
|
88
|
+
'to load libs they use to have passing specs', :slow do
|
89
|
+
loaded_features = @loaded_feature_lines.split("\n")
|
90
|
+
if RUBY_VERSION == '1.8.7'
|
91
|
+
# On 1.8.7, $" returns the relative require path if that was used
|
92
|
+
# to require the file. LIB_REGEX will not match the relative version
|
93
|
+
# since it has a `/lib` prefix. Here we deal with this by expanding
|
94
|
+
# relative files relative to the $LOAD_PATH dir (lib).
|
95
|
+
Dir.chdir("lib") { loaded_features.map! { |f| File.expand_path(f) } }
|
96
|
+
end
|
97
|
+
|
98
|
+
loaded_features.reject! { |feature| RSpec::CallerFilter::LIB_REGEX =~ feature }
|
99
|
+
loaded_features.reject! { |feature| allowed_loaded_feature_regexps.any? { |r| r =~ feature } }
|
100
|
+
|
101
|
+
expect(loaded_features).to eq([])
|
102
|
+
end
|
103
|
+
|
104
|
+
# This malformed whitespace detection logic has been borrowed from bundler:
|
105
|
+
# https://github.com/bundler/bundler/blob/v1.8.0/spec/quality_spec.rb
|
106
|
+
def check_for_tab_characters(filename)
|
107
|
+
failing_lines = []
|
108
|
+
File.readlines(filename).each_with_index do |line, number|
|
109
|
+
failing_lines << number + 1 if line =~ /\t/
|
110
|
+
end
|
111
|
+
|
112
|
+
return if failing_lines.empty?
|
113
|
+
"#{filename} has tab characters on lines #{failing_lines.join(', ')}"
|
114
|
+
end
|
115
|
+
|
116
|
+
def check_for_extra_spaces(filename)
|
117
|
+
failing_lines = []
|
118
|
+
File.readlines(filename).each_with_index do |line, number|
|
119
|
+
next if line =~ /^\s+#.*\s+\n$/
|
120
|
+
failing_lines << number + 1 if line =~ /\s+\n$/
|
121
|
+
end
|
122
|
+
|
123
|
+
return if failing_lines.empty?
|
124
|
+
"#{filename} has spaces on the EOL on lines #{failing_lines.join(', ')}"
|
125
|
+
end
|
126
|
+
|
127
|
+
RSpec::Matchers.define :be_well_formed do
|
128
|
+
match do |actual|
|
129
|
+
actual.empty?
|
130
|
+
end
|
131
|
+
|
132
|
+
failure_message do |actual|
|
133
|
+
actual.join("\n")
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
it "has no malformed whitespace", :slow do
|
138
|
+
error_messages = []
|
139
|
+
`git ls-files -z`.split("\x0").each do |filename|
|
140
|
+
error_messages << check_for_tab_characters(filename)
|
141
|
+
error_messages << check_for_extra_spaces(filename)
|
142
|
+
end
|
143
|
+
expect(error_messages.compact).to be_well_formed
|
144
|
+
end
|
145
|
+
end
|