sublimetheme 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,24 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2012 David Chelimsky, Myron Marston
|
4
|
+
Copyright (c) 2006 David Chelimsky, The RSpec Development Team
|
5
|
+
Copyright (c) 2005 Steven Baker
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
a copy of this software and associated documentation files (the
|
9
|
+
"Software"), to deal in the Software without restriction, including
|
10
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be
|
16
|
+
included in all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
21
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
22
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
23
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
24
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,289 @@
|
|
1
|
+
# RSpec Expectations [](http://travis-ci.org/rspec/rspec-expectations) [](https://codeclimate.com/github/rspec/rspec-expectations)
|
2
|
+
|
3
|
+
RSpec::Expectations lets you express expected outcomes on an object in an
|
4
|
+
example.
|
5
|
+
|
6
|
+
expect(account.balance).to eq(Money.new(37.42, :USD))
|
7
|
+
|
8
|
+
## Install
|
9
|
+
|
10
|
+
If you want to use rspec-expectations with rspec, just install the rspec gem
|
11
|
+
and RubyGems will also install rspec-expectations for you (along with
|
12
|
+
rspec-core and rspec-mocks):
|
13
|
+
|
14
|
+
gem install rspec
|
15
|
+
|
16
|
+
Want to run against the `master` branch? You'll need to include the dependent
|
17
|
+
RSpec repos as well. Add the following to your `Gemfile`:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
%w[rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib|
|
21
|
+
gem lib, :git => "git://github.com/rspec/#{lib}.git", :branch => 'master'
|
22
|
+
end
|
23
|
+
```
|
24
|
+
|
25
|
+
If you want to use rspec-expectations with another tool, like Test::Unit,
|
26
|
+
Minitest, or Cucumber, you can install it directly:
|
27
|
+
|
28
|
+
gem install rspec-expectations
|
29
|
+
|
30
|
+
## Basic usage
|
31
|
+
|
32
|
+
Here's an example using rspec-core:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
RSpec.describe Order do
|
36
|
+
it "sums the prices of the items in its line items" do
|
37
|
+
order = Order.new
|
38
|
+
order.add_entry(LineItem.new(:item => Item.new(
|
39
|
+
:price => Money.new(1.11, :USD)
|
40
|
+
)))
|
41
|
+
order.add_entry(LineItem.new(:item => Item.new(
|
42
|
+
:price => Money.new(2.22, :USD),
|
43
|
+
:quantity => 2
|
44
|
+
)))
|
45
|
+
expect(order.total).to eq(Money.new(5.55, :USD))
|
46
|
+
end
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
The `describe` and `it` methods come from rspec-core. The `Order`, `LineItem`, `Item` and `Money` classes would be from _your_ code. The last line of the example
|
51
|
+
expresses an expected outcome. If `order.total == Money.new(5.55, :USD)`, then
|
52
|
+
the example passes. If not, it fails with a message like:
|
53
|
+
|
54
|
+
expected: #<Money @value=5.55 @currency=:USD>
|
55
|
+
got: #<Money @value=1.11 @currency=:USD>
|
56
|
+
|
57
|
+
## Built-in matchers
|
58
|
+
|
59
|
+
### Equivalence
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
expect(actual).to eq(expected) # passes if actual == expected
|
63
|
+
expect(actual).to eql(expected) # passes if actual.eql?(expected)
|
64
|
+
expect(actual).not_to eql(not_expected) # passes if not(actual.eql?(expected))
|
65
|
+
```
|
66
|
+
|
67
|
+
Note: The new `expect` syntax no longer supports the `==` matcher.
|
68
|
+
|
69
|
+
### Identity
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
expect(actual).to be(expected) # passes if actual.equal?(expected)
|
73
|
+
expect(actual).to equal(expected) # passes if actual.equal?(expected)
|
74
|
+
```
|
75
|
+
|
76
|
+
### Comparisons
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
expect(actual).to be > expected
|
80
|
+
expect(actual).to be >= expected
|
81
|
+
expect(actual).to be <= expected
|
82
|
+
expect(actual).to be < expected
|
83
|
+
expect(actual).to be_within(delta).of(expected)
|
84
|
+
```
|
85
|
+
|
86
|
+
### Regular expressions
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
expect(actual).to match(/expression/)
|
90
|
+
```
|
91
|
+
|
92
|
+
Note: The new `expect` syntax no longer supports the `=~` matcher.
|
93
|
+
|
94
|
+
### Types/classes
|
95
|
+
|
96
|
+
```ruby
|
97
|
+
expect(actual).to be_an_instance_of(expected) # passes if actual.class == expected
|
98
|
+
expect(actual).to be_a(expected) # passes if actual.kind_of?(expected)
|
99
|
+
expect(actual).to be_an(expected) # an alias for be_a
|
100
|
+
expect(actual).to be_a_kind_of(expected) # another alias
|
101
|
+
```
|
102
|
+
|
103
|
+
### Truthiness
|
104
|
+
|
105
|
+
```ruby
|
106
|
+
expect(actual).to be_truthy # passes if actual is truthy (not nil or false)
|
107
|
+
expect(actual).to be true # passes if actual == true
|
108
|
+
expect(actual).to be_falsy # passes if actual is falsy (nil or false)
|
109
|
+
expect(actual).to be false # passes if actual == false
|
110
|
+
expect(actual).to be_nil # passes if actual is nil
|
111
|
+
expect(actual).to_not be_nil # passes if actual is not nil
|
112
|
+
```
|
113
|
+
|
114
|
+
### Expecting errors
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
expect { ... }.to raise_error
|
118
|
+
expect { ... }.to raise_error(ErrorClass)
|
119
|
+
expect { ... }.to raise_error("message")
|
120
|
+
expect { ... }.to raise_error(ErrorClass, "message")
|
121
|
+
```
|
122
|
+
|
123
|
+
### Expecting throws
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
expect { ... }.to throw_symbol
|
127
|
+
expect { ... }.to throw_symbol(:symbol)
|
128
|
+
expect { ... }.to throw_symbol(:symbol, 'value')
|
129
|
+
```
|
130
|
+
|
131
|
+
### Yielding
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
expect { |b| 5.tap(&b) }.to yield_control # passes regardless of yielded args
|
135
|
+
|
136
|
+
expect { |b| yield_if_true(true, &b) }.to yield_with_no_args # passes only if no args are yielded
|
137
|
+
|
138
|
+
expect { |b| 5.tap(&b) }.to yield_with_args(5)
|
139
|
+
expect { |b| 5.tap(&b) }.to yield_with_args(Fixnum)
|
140
|
+
expect { |b| "a string".tap(&b) }.to yield_with_args(/str/)
|
141
|
+
|
142
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_successive_args(1, 2, 3)
|
143
|
+
expect { |b| { :a => 1, :b => 2 }.each(&b) }.to yield_successive_args([:a, 1], [:b, 2])
|
144
|
+
```
|
145
|
+
|
146
|
+
### Predicate matchers
|
147
|
+
|
148
|
+
```ruby
|
149
|
+
expect(actual).to be_xxx # passes if actual.xxx?
|
150
|
+
expect(actual).to have_xxx(:arg) # passes if actual.has_xxx?(:arg)
|
151
|
+
```
|
152
|
+
|
153
|
+
### Ranges (Ruby >= 1.9 only)
|
154
|
+
|
155
|
+
```ruby
|
156
|
+
expect(1..10).to cover(3)
|
157
|
+
```
|
158
|
+
|
159
|
+
### Collection membership
|
160
|
+
|
161
|
+
```ruby
|
162
|
+
expect(actual).to include(expected)
|
163
|
+
expect(actual).to start_with(expected)
|
164
|
+
expect(actual).to end_with(expected)
|
165
|
+
|
166
|
+
expect(actual).to contain_exactly(individual, items)
|
167
|
+
# ...which is the same as:
|
168
|
+
expect(actual).to match_array(expected_array)
|
169
|
+
```
|
170
|
+
|
171
|
+
#### Examples
|
172
|
+
|
173
|
+
```ruby
|
174
|
+
expect([1, 2, 3]).to include(1)
|
175
|
+
expect([1, 2, 3]).to include(1, 2)
|
176
|
+
expect([1, 2, 3]).to start_with(1)
|
177
|
+
expect([1, 2, 3]).to start_with(1, 2)
|
178
|
+
expect([1, 2, 3]).to end_with(3)
|
179
|
+
expect([1, 2, 3]).to end_with(2, 3)
|
180
|
+
expect({:a => 'b'}).to include(:a => 'b')
|
181
|
+
expect("this string").to include("is str")
|
182
|
+
expect("this string").to start_with("this")
|
183
|
+
expect("this string").to end_with("ring")
|
184
|
+
expect([1, 2, 3]).to contain_exactly(2, 3, 1)
|
185
|
+
expect([1, 2, 3]).to match_array([3, 2, 1])
|
186
|
+
```
|
187
|
+
|
188
|
+
## `should` syntax
|
189
|
+
|
190
|
+
In addition to the `expect` syntax, rspec-expectations continues to support the
|
191
|
+
`should` syntax:
|
192
|
+
|
193
|
+
```ruby
|
194
|
+
actual.should eq expected
|
195
|
+
actual.should be > 3
|
196
|
+
[1, 2, 3].should_not include 4
|
197
|
+
```
|
198
|
+
|
199
|
+
See [detailed information on the `should` syntax and its usage.](https://github.com/rspec/rspec-expectations/blob/master/Should.md)
|
200
|
+
|
201
|
+
## Compound Matcher Expressions
|
202
|
+
|
203
|
+
You can also create compound matcher expressions using `and` or `or`:
|
204
|
+
|
205
|
+
``` ruby
|
206
|
+
expect(alphabet).to start_with("a").and end_with("z")
|
207
|
+
expect(stoplight.color).to eq("red").or eq("green").or eq("yellow")
|
208
|
+
```
|
209
|
+
|
210
|
+
## Composing Matchers
|
211
|
+
|
212
|
+
Many of the built-in matchers are designed to take matchers as
|
213
|
+
arguments, to allow you to flexibly specify only the essential
|
214
|
+
aspects of an object or data structure. In addition, all of the
|
215
|
+
built-in matchers have one or more aliases that provide better
|
216
|
+
phrasing for when they are used as arguments to another matcher.
|
217
|
+
|
218
|
+
### Examples
|
219
|
+
|
220
|
+
```ruby
|
221
|
+
expect { k += 1.05 }.to change { k }.by( a_value_within(0.1).of(1.0) )
|
222
|
+
|
223
|
+
expect { s = "barn" }.to change { s }
|
224
|
+
.from( a_string_matching(/foo/) )
|
225
|
+
.to( a_string_matching(/bar/) )
|
226
|
+
|
227
|
+
expect(["barn", 2.45]).to contain_exactly(
|
228
|
+
a_value_within(0.1).of(2.5),
|
229
|
+
a_string_starting_with("bar")
|
230
|
+
)
|
231
|
+
|
232
|
+
expect(["barn", "food", 2.45]).to end_with(
|
233
|
+
a_string_matching("foo"),
|
234
|
+
a_value > 2
|
235
|
+
)
|
236
|
+
|
237
|
+
expect(["barn", 2.45]).to include( a_string_starting_with("bar") )
|
238
|
+
|
239
|
+
expect(:a => "food", :b => "good").to include(:a => a_string_matching(/foo/))
|
240
|
+
|
241
|
+
hash = {
|
242
|
+
:a => {
|
243
|
+
:b => ["foo", 5],
|
244
|
+
:c => { :d => 2.05 }
|
245
|
+
}
|
246
|
+
}
|
247
|
+
|
248
|
+
expect(hash).to match(
|
249
|
+
:a => {
|
250
|
+
:b => a_collection_containing_exactly(
|
251
|
+
a_string_starting_with("f"),
|
252
|
+
an_instance_of(Fixnum)
|
253
|
+
),
|
254
|
+
:c => { :d => (a_value < 3) }
|
255
|
+
}
|
256
|
+
)
|
257
|
+
|
258
|
+
expect { |probe|
|
259
|
+
[1, 2, 3].each(&probe)
|
260
|
+
}.to yield_successive_args( a_value < 2, 2, a_value > 2 )
|
261
|
+
```
|
262
|
+
|
263
|
+
## Usage outside rspec-core
|
264
|
+
|
265
|
+
You always need to load `rspec/expectations` even if you only want to use one part of the library:
|
266
|
+
|
267
|
+
```ruby
|
268
|
+
require 'rspec/expectations'
|
269
|
+
```
|
270
|
+
|
271
|
+
Then simply include `RSpec::Matchers` in any class:
|
272
|
+
|
273
|
+
```ruby
|
274
|
+
class MyClass
|
275
|
+
include RSpec::Matchers
|
276
|
+
|
277
|
+
def do_something(arg)
|
278
|
+
expect(arg).to be > 0
|
279
|
+
# do other stuff
|
280
|
+
end
|
281
|
+
end
|
282
|
+
```
|
283
|
+
|
284
|
+
## Also see
|
285
|
+
|
286
|
+
* [http://github.com/rspec/rspec](http://github.com/rspec/rspec)
|
287
|
+
* [http://github.com/rspec/rspec-core](http://github.com/rspec/rspec-core)
|
288
|
+
* [http://github.com/rspec/rspec-mocks](http://github.com/rspec/rspec-mocks)
|
289
|
+
* [http://github.com/rspec/rspec-collection_matchers](https://github.com/rspec/rspec-collection_matchers)
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'rspec/support'
|
2
|
+
RSpec::Support.require_rspec_support "caller_filter"
|
3
|
+
RSpec::Support.require_rspec_support "warnings"
|
4
|
+
RSpec::Support.require_rspec_support "object_formatter"
|
5
|
+
|
6
|
+
require 'rspec/matchers'
|
7
|
+
|
8
|
+
RSpec::Support.define_optimized_require_for_rspec(:expectations) { |f| require_relative(f) }
|
9
|
+
|
10
|
+
%w[
|
11
|
+
expectation_target
|
12
|
+
configuration
|
13
|
+
fail_with
|
14
|
+
handler
|
15
|
+
version
|
16
|
+
].each { |file| RSpec::Support.require_rspec_expectations(file) }
|
17
|
+
|
18
|
+
module RSpec
|
19
|
+
# RSpec::Expectations provides a simple, readable API to express
|
20
|
+
# the expected outcomes in a code example. To express an expected
|
21
|
+
# outcome, wrap an object or block in `expect`, call `to` or `to_not`
|
22
|
+
# (aliased as `not_to`) and pass it a matcher object:
|
23
|
+
#
|
24
|
+
# expect(order.total).to eq(Money.new(5.55, :USD))
|
25
|
+
# expect(list).to include(user)
|
26
|
+
# expect(message).not_to match(/foo/)
|
27
|
+
# expect { do_something }.to raise_error
|
28
|
+
#
|
29
|
+
# The last form (the block form) is needed to match against ruby constructs
|
30
|
+
# that are not objects, but can only be observed when executing a block
|
31
|
+
# of code. This includes raising errors, throwing symbols, yielding,
|
32
|
+
# and changing values.
|
33
|
+
#
|
34
|
+
# When `expect(...).to` is invoked with a matcher, it turns around
|
35
|
+
# and calls `matcher.matches?(<object wrapped by expect>)`. For example,
|
36
|
+
# in the expression:
|
37
|
+
#
|
38
|
+
# expect(order.total).to eq(Money.new(5.55, :USD))
|
39
|
+
#
|
40
|
+
# ...`eq(Money.new(5.55, :USD))` returns a matcher object, and it results
|
41
|
+
# in the equivalent of `eq.matches?(order.total)`. If `matches?` returns
|
42
|
+
# `true`, the expectation is met and execution continues. If `false`, then
|
43
|
+
# the spec fails with the message returned by `eq.failure_message`.
|
44
|
+
#
|
45
|
+
# Given the expression:
|
46
|
+
#
|
47
|
+
# expect(order.entries).not_to include(entry)
|
48
|
+
#
|
49
|
+
# ...the `not_to` method (also available as `to_not`) invokes the equivalent of
|
50
|
+
# `include.matches?(order.entries)`, but it interprets `false` as success, and
|
51
|
+
# `true` as a failure, using the message generated by
|
52
|
+
# `include.failure_message_when_negated`.
|
53
|
+
#
|
54
|
+
# rspec-expectations ships with a standard set of useful matchers, and writing
|
55
|
+
# your own matchers is quite simple.
|
56
|
+
#
|
57
|
+
# See [RSpec::Matchers](../RSpec/Matchers) for more information about the
|
58
|
+
# built-in matchers that ship with rspec-expectations, and how to write your
|
59
|
+
# own custom matchers.
|
60
|
+
module Expectations
|
61
|
+
# Exception raised when an expectation fails.
|
62
|
+
#
|
63
|
+
# @note We subclass Exception so that in a stub implementation if
|
64
|
+
# the user sets an expectation, it can't be caught in their
|
65
|
+
# code by a bare `rescue`.
|
66
|
+
# @api public
|
67
|
+
class ExpectationNotMetError < Exception
|
68
|
+
end
|
69
|
+
|
70
|
+
# Exception raised from `aggregate_failures` when multiple expectations fail.
|
71
|
+
#
|
72
|
+
# @note The constant is defined here but the extensive logic of this class
|
73
|
+
# is lazily defined when `FailureAggregator` is autoloaded, since we do
|
74
|
+
# not need to waste time defining that functionality unless
|
75
|
+
# `aggregate_failures` is used.
|
76
|
+
class MultipleExpectationsNotMetError < ExpectationNotMetError
|
77
|
+
end
|
78
|
+
|
79
|
+
autoload :FailureAggregator, "rspec/expectations/failure_aggregator"
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,164 @@
|
|
1
|
+
RSpec::Support.require_rspec_expectations "syntax"
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Expectations
|
5
|
+
# Provides configuration options for rspec-expectations.
|
6
|
+
# If you are using rspec-core, you can access this via a
|
7
|
+
# block passed to `RSpec::Core::Configuration#expect_with`.
|
8
|
+
# Otherwise, you can access it via RSpec::Expectations.configuration.
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# RSpec.configure do |rspec|
|
12
|
+
# rspec.expect_with :rspec do |c|
|
13
|
+
# # c is the config object
|
14
|
+
# end
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# # or
|
18
|
+
#
|
19
|
+
# RSpec::Expectations.configuration
|
20
|
+
class Configuration
|
21
|
+
def initialize
|
22
|
+
@warn_about_potential_false_positives = true
|
23
|
+
end
|
24
|
+
|
25
|
+
# Configures the supported syntax.
|
26
|
+
# @param [Array<Symbol>, Symbol] values the syntaxes to enable
|
27
|
+
# @example
|
28
|
+
# RSpec.configure do |rspec|
|
29
|
+
# rspec.expect_with :rspec do |c|
|
30
|
+
# c.syntax = :should
|
31
|
+
# # or
|
32
|
+
# c.syntax = :expect
|
33
|
+
# # or
|
34
|
+
# c.syntax = [:should, :expect]
|
35
|
+
# end
|
36
|
+
# end
|
37
|
+
def syntax=(values)
|
38
|
+
if Array(values).include?(:expect)
|
39
|
+
Expectations::Syntax.enable_expect
|
40
|
+
else
|
41
|
+
Expectations::Syntax.disable_expect
|
42
|
+
end
|
43
|
+
|
44
|
+
if Array(values).include?(:should)
|
45
|
+
Expectations::Syntax.enable_should
|
46
|
+
else
|
47
|
+
Expectations::Syntax.disable_should
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# The list of configured syntaxes.
|
52
|
+
# @return [Array<Symbol>] the list of configured syntaxes.
|
53
|
+
# @example
|
54
|
+
# unless RSpec::Matchers.configuration.syntax.include?(:expect)
|
55
|
+
# raise "this RSpec extension gem requires the rspec-expectations `:expect` syntax"
|
56
|
+
# end
|
57
|
+
def syntax
|
58
|
+
syntaxes = []
|
59
|
+
syntaxes << :should if Expectations::Syntax.should_enabled?
|
60
|
+
syntaxes << :expect if Expectations::Syntax.expect_enabled?
|
61
|
+
syntaxes
|
62
|
+
end
|
63
|
+
|
64
|
+
if ::RSpec.respond_to?(:configuration)
|
65
|
+
def color?
|
66
|
+
::RSpec.configuration.color_enabled?
|
67
|
+
end
|
68
|
+
else
|
69
|
+
# Indicates whether or not diffs should be colored.
|
70
|
+
# Delegates to rspec-core's color option if rspec-core
|
71
|
+
# is loaded; otherwise you can set it here.
|
72
|
+
attr_writer :color
|
73
|
+
|
74
|
+
# Indicates whether or not diffs should be colored.
|
75
|
+
# Delegates to rspec-core's color option if rspec-core
|
76
|
+
# is loaded; otherwise you can set it here.
|
77
|
+
def color?
|
78
|
+
defined?(@color) && @color
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Adds `should` and `should_not` to the given classes
|
83
|
+
# or modules. This can be used to ensure `should` works
|
84
|
+
# properly on things like proxy objects (particular
|
85
|
+
# `Delegator`-subclassed objects on 1.8).
|
86
|
+
#
|
87
|
+
# @param [Array<Module>] modules the list of classes or modules
|
88
|
+
# to add `should` and `should_not` to.
|
89
|
+
def add_should_and_should_not_to(*modules)
|
90
|
+
modules.each do |mod|
|
91
|
+
Expectations::Syntax.enable_should(mod)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Sets or gets the backtrace formatter. The backtrace formatter should
|
96
|
+
# implement `#format_backtrace(Array<String>)`. This is used
|
97
|
+
# to format backtraces of errors handled by the `raise_error`
|
98
|
+
# matcher.
|
99
|
+
#
|
100
|
+
# If you are using rspec-core, rspec-core's backtrace formatting
|
101
|
+
# will be used (including respecting the presence or absence of
|
102
|
+
# the `--backtrace` option).
|
103
|
+
#
|
104
|
+
# @!attribute [rw] backtrace_formatter
|
105
|
+
attr_writer :backtrace_formatter
|
106
|
+
def backtrace_formatter
|
107
|
+
@backtrace_formatter ||= if defined?(::RSpec.configuration.backtrace_formatter)
|
108
|
+
::RSpec.configuration.backtrace_formatter
|
109
|
+
else
|
110
|
+
NullBacktraceFormatter
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
# Sets if custom matcher descriptions and failure messages
|
115
|
+
# should include clauses from methods defined using `chain`.
|
116
|
+
# @param value [Boolean]
|
117
|
+
attr_writer :include_chain_clauses_in_custom_matcher_descriptions
|
118
|
+
|
119
|
+
# Indicates whether or not custom matcher descriptions and failure messages
|
120
|
+
# should include clauses from methods defined using `chain`. It is
|
121
|
+
# false by default for backwards compatibility.
|
122
|
+
def include_chain_clauses_in_custom_matcher_descriptions?
|
123
|
+
@include_chain_clauses_in_custom_matcher_descriptions ||= false
|
124
|
+
end
|
125
|
+
|
126
|
+
# @private
|
127
|
+
def reset_syntaxes_to_default
|
128
|
+
self.syntax = [:should, :expect]
|
129
|
+
RSpec::Expectations::Syntax.warn_about_should!
|
130
|
+
end
|
131
|
+
|
132
|
+
# @api private
|
133
|
+
# Null implementation of a backtrace formatter used by default
|
134
|
+
# when rspec-core is not loaded. Does no filtering.
|
135
|
+
NullBacktraceFormatter = Module.new do
|
136
|
+
def self.format_backtrace(backtrace)
|
137
|
+
backtrace
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# Configures whether RSpec will warn about matcher use which will
|
142
|
+
# potentially cause false positives in tests.
|
143
|
+
#
|
144
|
+
# @param value [Boolean]
|
145
|
+
attr_writer :warn_about_potential_false_positives
|
146
|
+
|
147
|
+
# Indicates whether RSpec will warn about matcher use which will
|
148
|
+
# potentially cause false positives in tests, generally you want to
|
149
|
+
# avoid such scenarios so this defaults to `true`.
|
150
|
+
def warn_about_potential_false_positives?
|
151
|
+
@warn_about_potential_false_positives
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# The configuration object.
|
156
|
+
# @return [RSpec::Expectations::Configuration] the configuration object
|
157
|
+
def self.configuration
|
158
|
+
@configuration ||= Configuration.new
|
159
|
+
end
|
160
|
+
|
161
|
+
# set default syntax
|
162
|
+
configuration.reset_syntaxes_to_default
|
163
|
+
end
|
164
|
+
end
|