genkaio 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.bundle/config +2 -0
- data/.gitignore +2 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +34 -0
- data/LICENSE.txt +21 -0
- data/README.md +78 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/genkaio +66 -0
- data/bin/setup +8 -0
- data/demo.gif +0 -0
- data/genkaio.gemspec +28 -0
- data/lib/.genkaio.rb.swp +0 -0
- data/lib/dic/dicdata_2019_1108 +212408 -0
- data/lib/genkaio/version.rb +3 -0
- data/lib/genkaio.rb +73 -0
- data/pkg/genkaio-0.0.1.gem +0 -0
- data/vendor/bundle/ruby/2.5.0/bin/genkaio +27 -0
- data/vendor/bundle/ruby/2.5.0/bin/htmldiff +29 -0
- data/vendor/bundle/ruby/2.5.0/bin/ldiff +29 -0
- data/vendor/bundle/ruby/2.5.0/bin/rake +27 -0
- data/vendor/bundle/ruby/2.5.0/bin/rspec +27 -0
- data/vendor/bundle/ruby/2.5.0/cache/diff-lcs-1.3.gem +0 -0
- data/vendor/bundle/ruby/2.5.0/cache/rake-12.3.3.gem +0 -0
- data/vendor/bundle/ruby/2.5.0/cache/rspec-3.9.0.gem +0 -0
- data/vendor/bundle/ruby/2.5.0/cache/rspec-core-3.9.0.gem +0 -0
- data/vendor/bundle/ruby/2.5.0/cache/rspec-expectations-3.9.0.gem +0 -0
- data/vendor/bundle/ruby/2.5.0/cache/rspec-mocks-3.9.0.gem +0 -0
- data/vendor/bundle/ruby/2.5.0/cache/rspec-support-3.9.0.gem +0 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/.rspec +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/Code-of-Conduct.md +74 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/Contributing.md +83 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/History.md +220 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/License.md +39 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/Manifest.txt +37 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/README.rdoc +84 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/Rakefile +57 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/autotest/discover.rb +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/bin/htmldiff +32 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/bin/ldiff +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/docs/COPYING.txt +339 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/docs/artistic.txt +127 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs/array.rb +7 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs/block.rb +37 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs/callbacks.rb +322 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs/change.rb +181 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs/htmldiff.rb +149 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs/hunk.rb +276 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs/internals.rb +307 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs/ldiff.rb +167 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs/string.rb +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff/lcs.rb +725 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/lib/diff-lcs.rb +3 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/change_spec.rb +65 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/diff_spec.rb +47 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/fixtures/ds1.csv +50 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/fixtures/ds2.csv +51 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/hunk_spec.rb +72 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/issues_spec.rb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/lcs_spec.rb +56 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/ldiff_spec.rb +47 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/patch_spec.rb +422 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/sdiff_spec.rb +214 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/spec_helper.rb +321 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/traverse_balanced_spec.rb +310 -0
- data/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/spec/traverse_sequences_spec.rb +139 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/CONTRIBUTING.rdoc +43 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/Gemfile +3 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/History.rdoc +2344 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/README.rdoc +156 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/Rakefile +41 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/azure-pipelines.yml +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/bin/bundle +105 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/bin/console +7 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/bin/rake +29 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/bin/rdoc +29 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/bin/rubocop +29 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/bin/setup +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/command_line_usage.rdoc +158 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/glossary.rdoc +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/jamis.rb +592 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/rake.1 +156 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/rakefile.rdoc +622 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/exe/rake +27 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/application.rb +824 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/backtrace.rb +24 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/clean.rb +78 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/cloneable.rb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/cpu_counter.rb +107 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/default_loader.rb +15 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/dsl_definition.rb +195 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/early_time.rb +22 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/ext/core.rb +26 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/ext/string.rb +176 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/file_creation_task.rb +25 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/file_list.rb +435 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/file_task.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/file_utils.rb +137 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/file_utils_ext.rb +145 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/invocation_chain.rb +57 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/invocation_exception_mixin.rb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/late_time.rb +18 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/linked_list.rb +112 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/loaders/makefile.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/multi_task.rb +14 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/name_space.rb +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/packagetask.rb +207 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/phony.rb +16 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/private_reader.rb +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/promise.rb +100 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/pseudo_status.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/rake_module.rb +67 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/rake_test_loader.rb +27 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/scope.rb +43 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/task.rb +413 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/task_argument_error.rb +8 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/task_arguments.rb +109 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/task_manager.rb +324 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/tasklib.rb +12 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/testtask.rb +224 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/thread_history_display.rb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/thread_pool.rb +163 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/trace_output.rb +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/version.rb +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake/win32.rb +51 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/lib/rake.rb +71 -0
- data/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/rake.gemspec +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-3.9.0/LICENSE.md +27 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-3.9.0/README.md +43 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-3.9.0/lib/rspec/version.rb +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-3.9.0/lib/rspec.rb +3 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/.document +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/.yardopts +8 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/Changelog.md +2265 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/LICENSE.md +26 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/README.md +384 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/exe/rspec +4 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/autorun.rb +3 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/backtrace_formatter.rb +65 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/bisect/coordinator.rb +62 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/bisect/example_minimizer.rb +173 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/bisect/fork_runner.rb +134 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/bisect/server.rb +61 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/bisect/shell_command.rb +126 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/bisect/shell_runner.rb +73 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/bisect/utilities.rb +58 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/configuration.rb +2336 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/configuration_options.rb +233 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/did_you_mean.rb +46 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/drb.rb +113 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/dsl.rb +98 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/example.rb +656 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/example_group.rb +889 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/example_status_persister.rb +235 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/filter_manager.rb +231 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/flat_map.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/base_bisect_formatter.rb +45 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/base_formatter.rb +70 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/base_text_formatter.rb +75 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/bisect_drb_formatter.rb +29 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/bisect_progress_formatter.rb +157 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/console_codes.rb +68 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/documentation_formatter.rb +102 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/exception_presenter.rb +508 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/failure_list_formatter.rb +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/helpers.rb +110 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/html_formatter.rb +153 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/html_printer.rb +414 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/html_snippet_extractor.rb +120 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/json_formatter.rb +102 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/profile_formatter.rb +68 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/progress_formatter.rb +29 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/protocol.rb +182 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/snippet_extractor.rb +134 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters/syntax_highlighter.rb +91 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/formatters.rb +272 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/hooks.rb +632 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/invocations.rb +87 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/memoized_helpers.rb +554 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/metadata.rb +498 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/metadata_filter.rb +255 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/mocking_adapters/null.rb +14 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/mocking_adapters/rr.rb +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/notifications.rb +521 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/option_parser.rb +317 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/ordering.rb +158 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/output_wrapper.rb +29 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/pending.rb +165 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/profiler.rb +34 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/project_initializer/.rspec +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/project_initializer/spec/spec_helper.rb +100 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/project_initializer.rb +48 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/rake_task.rb +188 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/reporter.rb +265 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/ruby_project.rb +53 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/runner.rb +204 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/sandbox.rb +37 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/set.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/shared_context.rb +55 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/shared_example_group.rb +269 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/shell_escape.rb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/version.rb +9 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/warnings.rb +40 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core/world.rb +275 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.0/lib/rspec/core.rb +186 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/.document +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/.yardopts +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/Changelog.md +1170 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/LICENSE.md +25 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/README.md +320 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/block_snippet_extractor.rb +253 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/configuration.rb +215 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/expectation_target.rb +127 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/fail_with.rb +39 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/failure_aggregator.rb +194 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/handler.rb +170 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/minitest_integration.rb +58 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/syntax.rb +132 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations/version.rb +8 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/expectations.rb +82 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/aliased_matcher.rb +116 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/all.rb +86 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/base_matcher.rb +193 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be.rb +288 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_between.rb +77 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_instance_of.rb +26 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_kind_of.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/be_within.rb +72 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/change.rb +428 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/compound.rb +276 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/contain_exactly.rb +302 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/cover.rb +24 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/eq.rb +40 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/eql.rb +34 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/equal.rb +81 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/exist.rb +90 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/has.rb +103 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/include.rb +149 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/match.rb +106 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/operators.rb +128 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/output.rb +200 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/raise_error.rb +230 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/respond_to.rb +174 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/satisfy.rb +60 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/start_or_end_with.rb +94 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/throw_symbol.rb +132 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/yield.rb +432 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in.rb +52 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/composable.rb +171 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/dsl.rb +534 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/english_phrasing.rb +58 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +82 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/fail_matchers.rb +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/generated_descriptions.rb +41 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/matcher_delegator.rb +35 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/matcher_protocol.rb +99 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers.rb +1038 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/.document +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/.yardopts +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/Changelog.md +1125 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/LICENSE.md +25 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/README.md +463 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance/chain.rb +111 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance/expect_chain_chain.rb +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance/expectation_chain.rb +50 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance/message_chains.rb +83 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance/proxy.rb +116 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance/recorder.rb +289 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance/stub_chain.rb +51 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance/stub_chain_chain.rb +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/any_instance.rb +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/argument_list_matcher.rb +100 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/argument_matchers.rb +322 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/configuration.rb +212 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/error_generator.rb +369 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/example_methods.rb +434 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/instance_method_stasher.rb +146 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/marshal_extension.rb +41 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/matchers/expectation_customization.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/matchers/have_received.rb +134 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/matchers/receive.rb +132 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/matchers/receive_message_chain.rb +82 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/matchers/receive_messages.rb +77 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/message_chain.rb +87 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/message_expectation.rb +751 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/method_double.rb +287 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/method_reference.rb +202 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/minitest_integration.rb +68 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/mutate_const.rb +339 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/object_reference.rb +149 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/order_group.rb +81 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/proxy.rb +503 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/space.rb +238 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/standalone.rb +3 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/syntax.rb +325 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/targets.rb +124 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/test_double.rb +171 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/verifying_double.rb +129 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/verifying_message_expectation.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/verifying_proxy.rb +220 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks/version.rb +9 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-mocks-3.9.0/lib/rspec/mocks.rb +130 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/Changelog.md +275 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/LICENSE.md +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/README.md +40 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/caller_filter.rb +83 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/comparable_version.rb +46 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/differ.rb +215 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/directory_maker.rb +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/encoded_string.rb +165 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/fuzzy_matcher.rb +48 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/hunk_generator.rb +47 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/matcher_definition.rb +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/method_signature_verifier.rb +438 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/mutex.rb +73 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/object_formatter.rb +275 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/recursive_const_methods.rb +76 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/reentrant_mutex.rb +53 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/ruby_features.rb +176 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/source/location.rb +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/source/node.rb +110 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/source/token.rb +87 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/source.rb +75 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec/deprecation_helpers.rb +64 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec/formatting_support.rb +9 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec/in_sub_process.rb +69 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec/library_wide_checks.rb +150 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec/shell_out.rb +89 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec/stderr_splitter.rb +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec/string_matcher.rb +46 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec/with_isolated_directory.rb +13 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec/with_isolated_stderr.rb +13 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/spec.rb +81 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/version.rb +7 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support/warnings.rb +39 -0
- data/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.0/lib/rspec/support.rb +149 -0
- data/vendor/bundle/ruby/2.5.0/specifications/diff-lcs-1.3.gemspec +61 -0
- data/vendor/bundle/ruby/2.5.0/specifications/rake-12.3.3.gemspec +49 -0
- data/vendor/bundle/ruby/2.5.0/specifications/rspec-3.9.0.gemspec +43 -0
- data/vendor/bundle/ruby/2.5.0/specifications/rspec-core-3.9.0.gemspec +63 -0
- data/vendor/bundle/ruby/2.5.0/specifications/rspec-expectations-3.9.0.gemspec +51 -0
- data/vendor/bundle/ruby/2.5.0/specifications/rspec-mocks-3.9.0.gemspec +51 -0
- data/vendor/bundle/ruby/2.5.0/specifications/rspec-support-3.9.0.gemspec +39 -0
- metadata +411 -0
@@ -0,0 +1,100 @@
|
|
1
|
+
# We intentionally do not use the `RSpec::Support.require...` methods
|
2
|
+
# here so that this file can be loaded individually, as documented
|
3
|
+
# below.
|
4
|
+
require 'rspec/mocks/argument_matchers'
|
5
|
+
require 'rspec/support/fuzzy_matcher'
|
6
|
+
|
7
|
+
module RSpec
|
8
|
+
module Mocks
|
9
|
+
# Wrapper for matching arguments against a list of expected values. Used by
|
10
|
+
# the `with` method on a `MessageExpectation`:
|
11
|
+
#
|
12
|
+
# expect(object).to receive(:message).with(:a, 'b', 3)
|
13
|
+
# object.message(:a, 'b', 3)
|
14
|
+
#
|
15
|
+
# Values passed to `with` can be literal values or argument matchers that
|
16
|
+
# match against the real objects .e.g.
|
17
|
+
#
|
18
|
+
# expect(object).to receive(:message).with(hash_including(:a => 'b'))
|
19
|
+
#
|
20
|
+
# Can also be used directly to match the contents of any `Array`. This
|
21
|
+
# enables 3rd party mocking libs to take advantage of rspec's argument
|
22
|
+
# matching without using the rest of rspec-mocks.
|
23
|
+
#
|
24
|
+
# require 'rspec/mocks/argument_list_matcher'
|
25
|
+
# include RSpec::Mocks::ArgumentMatchers
|
26
|
+
#
|
27
|
+
# arg_list_matcher = RSpec::Mocks::ArgumentListMatcher.new(123, hash_including(:a => 'b'))
|
28
|
+
# arg_list_matcher.args_match?(123, :a => 'b')
|
29
|
+
#
|
30
|
+
# This class is immutable.
|
31
|
+
#
|
32
|
+
# @see ArgumentMatchers
|
33
|
+
class ArgumentListMatcher
|
34
|
+
# @private
|
35
|
+
attr_reader :expected_args
|
36
|
+
|
37
|
+
# @api public
|
38
|
+
# @param [Array] expected_args a list of expected literals and/or argument matchers
|
39
|
+
#
|
40
|
+
# Initializes an `ArgumentListMatcher` with a collection of literal
|
41
|
+
# values and/or argument matchers.
|
42
|
+
#
|
43
|
+
# @see ArgumentMatchers
|
44
|
+
# @see #args_match?
|
45
|
+
def initialize(*expected_args)
|
46
|
+
@expected_args = expected_args
|
47
|
+
ensure_expected_args_valid!
|
48
|
+
end
|
49
|
+
|
50
|
+
# @api public
|
51
|
+
# @param [Array] args
|
52
|
+
#
|
53
|
+
# Matches each element in the `expected_args` against the element in the same
|
54
|
+
# position of the arguments passed to `new`.
|
55
|
+
#
|
56
|
+
# @see #initialize
|
57
|
+
def args_match?(*args)
|
58
|
+
Support::FuzzyMatcher.values_match?(resolve_expected_args_based_on(args), args)
|
59
|
+
end
|
60
|
+
|
61
|
+
# @private
|
62
|
+
# Resolves abstract arg placeholders like `no_args` and `any_args` into
|
63
|
+
# a more concrete arg list based on the provided `actual_args`.
|
64
|
+
def resolve_expected_args_based_on(actual_args)
|
65
|
+
return [] if [ArgumentMatchers::NoArgsMatcher::INSTANCE] == expected_args
|
66
|
+
|
67
|
+
any_args_index = expected_args.index { |a| ArgumentMatchers::AnyArgsMatcher::INSTANCE == a }
|
68
|
+
return expected_args unless any_args_index
|
69
|
+
|
70
|
+
replace_any_args_with_splat_of_anything(any_args_index, actual_args.count)
|
71
|
+
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
def replace_any_args_with_splat_of_anything(before_count, actual_args_count)
|
76
|
+
any_args_count = actual_args_count - expected_args.count + 1
|
77
|
+
after_count = expected_args.count - before_count - 1
|
78
|
+
|
79
|
+
any_args = 1.upto(any_args_count).map { ArgumentMatchers::AnyArgMatcher::INSTANCE }
|
80
|
+
expected_args.first(before_count) + any_args + expected_args.last(after_count)
|
81
|
+
end
|
82
|
+
|
83
|
+
def ensure_expected_args_valid!
|
84
|
+
if expected_args.count { |a| ArgumentMatchers::AnyArgsMatcher::INSTANCE == a } > 1
|
85
|
+
raise ArgumentError, "`any_args` can only be passed to " \
|
86
|
+
"`with` once but you have passed it multiple times."
|
87
|
+
elsif expected_args.count > 1 && expected_args.any? { |a| ArgumentMatchers::NoArgsMatcher::INSTANCE == a }
|
88
|
+
raise ArgumentError, "`no_args` can only be passed as a " \
|
89
|
+
"singleton argument to `with` (i.e. `with(no_args)`), " \
|
90
|
+
"but you have passed additional arguments."
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# Value that will match all argument lists.
|
95
|
+
#
|
96
|
+
# @private
|
97
|
+
MATCH_ALL = new(ArgumentMatchers::AnyArgsMatcher::INSTANCE)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,322 @@
|
|
1
|
+
# This cannot take advantage of our relative requires, since this file is a
|
2
|
+
# dependency of `rspec/mocks/argument_list_matcher.rb`. See comment there for
|
3
|
+
# details.
|
4
|
+
require 'rspec/support/matcher_definition'
|
5
|
+
|
6
|
+
module RSpec
|
7
|
+
module Mocks
|
8
|
+
# ArgumentMatchers are placeholders that you can include in message
|
9
|
+
# expectations to match arguments against a broader check than simple
|
10
|
+
# equality.
|
11
|
+
#
|
12
|
+
# With the exception of `any_args` and `no_args`, they all match against
|
13
|
+
# the arg in same position in the argument list.
|
14
|
+
#
|
15
|
+
# @see ArgumentListMatcher
|
16
|
+
module ArgumentMatchers
|
17
|
+
# Acts like an arg splat, matching any number of args at any point in an arg list.
|
18
|
+
#
|
19
|
+
# @example
|
20
|
+
# expect(object).to receive(:message).with(1, 2, any_args)
|
21
|
+
#
|
22
|
+
# # matches any of these:
|
23
|
+
# object.message(1, 2)
|
24
|
+
# object.message(1, 2, 3)
|
25
|
+
# object.message(1, 2, 3, 4)
|
26
|
+
def any_args
|
27
|
+
AnyArgsMatcher::INSTANCE
|
28
|
+
end
|
29
|
+
|
30
|
+
# Matches any argument at all.
|
31
|
+
#
|
32
|
+
# @example
|
33
|
+
# expect(object).to receive(:message).with(anything)
|
34
|
+
def anything
|
35
|
+
AnyArgMatcher::INSTANCE
|
36
|
+
end
|
37
|
+
|
38
|
+
# Matches no arguments.
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# expect(object).to receive(:message).with(no_args)
|
42
|
+
def no_args
|
43
|
+
NoArgsMatcher::INSTANCE
|
44
|
+
end
|
45
|
+
|
46
|
+
# Matches if the actual argument responds to the specified messages.
|
47
|
+
#
|
48
|
+
# @example
|
49
|
+
# expect(object).to receive(:message).with(duck_type(:hello))
|
50
|
+
# expect(object).to receive(:message).with(duck_type(:hello, :goodbye))
|
51
|
+
def duck_type(*args)
|
52
|
+
DuckTypeMatcher.new(*args)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Matches a boolean value.
|
56
|
+
#
|
57
|
+
# @example
|
58
|
+
# expect(object).to receive(:message).with(boolean())
|
59
|
+
def boolean
|
60
|
+
BooleanMatcher::INSTANCE
|
61
|
+
end
|
62
|
+
|
63
|
+
# Matches a hash that includes the specified key(s) or key/value pairs.
|
64
|
+
# Ignores any additional keys.
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# expect(object).to receive(:message).with(hash_including(:key => val))
|
68
|
+
# expect(object).to receive(:message).with(hash_including(:key))
|
69
|
+
# expect(object).to receive(:message).with(hash_including(:key, :key2 => val2))
|
70
|
+
def hash_including(*args)
|
71
|
+
HashIncludingMatcher.new(ArgumentMatchers.anythingize_lonely_keys(*args))
|
72
|
+
end
|
73
|
+
|
74
|
+
# Matches an array that includes the specified items at least once.
|
75
|
+
# Ignores duplicates and additional values
|
76
|
+
#
|
77
|
+
# @example
|
78
|
+
# expect(object).to receive(:message).with(array_including(1,2,3))
|
79
|
+
# expect(object).to receive(:message).with(array_including([1,2,3]))
|
80
|
+
def array_including(*args)
|
81
|
+
actually_an_array = Array === args.first && args.count == 1 ? args.first : args
|
82
|
+
ArrayIncludingMatcher.new(actually_an_array)
|
83
|
+
end
|
84
|
+
|
85
|
+
# Matches a hash that doesn't include the specified key(s) or key/value.
|
86
|
+
#
|
87
|
+
# @example
|
88
|
+
# expect(object).to receive(:message).with(hash_excluding(:key => val))
|
89
|
+
# expect(object).to receive(:message).with(hash_excluding(:key))
|
90
|
+
# expect(object).to receive(:message).with(hash_excluding(:key, :key2 => :val2))
|
91
|
+
def hash_excluding(*args)
|
92
|
+
HashExcludingMatcher.new(ArgumentMatchers.anythingize_lonely_keys(*args))
|
93
|
+
end
|
94
|
+
|
95
|
+
alias_method :hash_not_including, :hash_excluding
|
96
|
+
|
97
|
+
# Matches if `arg.instance_of?(klass)`
|
98
|
+
#
|
99
|
+
# @example
|
100
|
+
# expect(object).to receive(:message).with(instance_of(Thing))
|
101
|
+
def instance_of(klass)
|
102
|
+
InstanceOf.new(klass)
|
103
|
+
end
|
104
|
+
|
105
|
+
alias_method :an_instance_of, :instance_of
|
106
|
+
|
107
|
+
# Matches if `arg.kind_of?(klass)`
|
108
|
+
#
|
109
|
+
# @example
|
110
|
+
# expect(object).to receive(:message).with(kind_of(Thing))
|
111
|
+
def kind_of(klass)
|
112
|
+
KindOf.new(klass)
|
113
|
+
end
|
114
|
+
|
115
|
+
alias_method :a_kind_of, :kind_of
|
116
|
+
|
117
|
+
# @private
|
118
|
+
def self.anythingize_lonely_keys(*args)
|
119
|
+
hash = Hash === args.last ? args.delete_at(-1) : {}
|
120
|
+
args.each { | arg | hash[arg] = AnyArgMatcher::INSTANCE }
|
121
|
+
hash
|
122
|
+
end
|
123
|
+
|
124
|
+
# Intended to be subclassed by stateless, immutable argument matchers.
|
125
|
+
# Provides a `<klass name>::INSTANCE` constant for accessing a global
|
126
|
+
# singleton instance of the matcher. There is no need to construct
|
127
|
+
# multiple instance since there is no state. It also facilities the
|
128
|
+
# special case logic we need for some of these matchers, by making it
|
129
|
+
# easy to do comparisons like: `[klass::INSTANCE] == args` rather than
|
130
|
+
# `args.count == 1 && klass === args.first`.
|
131
|
+
#
|
132
|
+
# @private
|
133
|
+
class SingletonMatcher
|
134
|
+
private_class_method :new
|
135
|
+
|
136
|
+
def self.inherited(subklass)
|
137
|
+
subklass.const_set(:INSTANCE, subklass.send(:new))
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# @private
|
142
|
+
class AnyArgsMatcher < SingletonMatcher
|
143
|
+
def description
|
144
|
+
"*(any args)"
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# @private
|
149
|
+
class AnyArgMatcher < SingletonMatcher
|
150
|
+
def ===(_other)
|
151
|
+
true
|
152
|
+
end
|
153
|
+
|
154
|
+
def description
|
155
|
+
"anything"
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# @private
|
160
|
+
class NoArgsMatcher < SingletonMatcher
|
161
|
+
def description
|
162
|
+
"no args"
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# @private
|
167
|
+
class BooleanMatcher < SingletonMatcher
|
168
|
+
def ===(value)
|
169
|
+
true == value || false == value
|
170
|
+
end
|
171
|
+
|
172
|
+
def description
|
173
|
+
"boolean"
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# @private
|
178
|
+
class BaseHashMatcher
|
179
|
+
def initialize(expected)
|
180
|
+
@expected = expected
|
181
|
+
end
|
182
|
+
|
183
|
+
def ===(predicate, actual)
|
184
|
+
@expected.__send__(predicate) do |k, v|
|
185
|
+
actual.key?(k) && Support::FuzzyMatcher.values_match?(v, actual[k])
|
186
|
+
end
|
187
|
+
rescue NoMethodError
|
188
|
+
false
|
189
|
+
end
|
190
|
+
|
191
|
+
def description(name)
|
192
|
+
"#{name}(#{formatted_expected_hash.inspect.sub(/^\{/, "").sub(/\}$/, "")})"
|
193
|
+
end
|
194
|
+
|
195
|
+
private
|
196
|
+
|
197
|
+
def formatted_expected_hash
|
198
|
+
Hash[
|
199
|
+
@expected.map do |k, v|
|
200
|
+
k = RSpec::Support.rspec_description_for_object(k)
|
201
|
+
v = RSpec::Support.rspec_description_for_object(v)
|
202
|
+
|
203
|
+
[k, v]
|
204
|
+
end
|
205
|
+
]
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# @private
|
210
|
+
class HashIncludingMatcher < BaseHashMatcher
|
211
|
+
def ===(actual)
|
212
|
+
super(:all?, actual)
|
213
|
+
end
|
214
|
+
|
215
|
+
def description
|
216
|
+
super("hash_including")
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
# @private
|
221
|
+
class HashExcludingMatcher < BaseHashMatcher
|
222
|
+
def ===(actual)
|
223
|
+
super(:none?, actual)
|
224
|
+
end
|
225
|
+
|
226
|
+
def description
|
227
|
+
super("hash_not_including")
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
# @private
|
232
|
+
class ArrayIncludingMatcher
|
233
|
+
def initialize(expected)
|
234
|
+
@expected = expected
|
235
|
+
end
|
236
|
+
|
237
|
+
def ===(actual)
|
238
|
+
actual = actual.uniq
|
239
|
+
@expected.uniq.all? do |expected_element|
|
240
|
+
actual.any? do |actual_element|
|
241
|
+
RSpec::Support::FuzzyMatcher.values_match?(expected_element, actual_element)
|
242
|
+
end
|
243
|
+
end
|
244
|
+
rescue NoMethodError
|
245
|
+
false
|
246
|
+
end
|
247
|
+
|
248
|
+
def description
|
249
|
+
"array_including(#{formatted_expected_values})"
|
250
|
+
end
|
251
|
+
|
252
|
+
private
|
253
|
+
|
254
|
+
def formatted_expected_values
|
255
|
+
@expected.map do |x|
|
256
|
+
RSpec::Support.rspec_description_for_object(x)
|
257
|
+
end.join(", ")
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
# @private
|
262
|
+
class DuckTypeMatcher
|
263
|
+
def initialize(*methods_to_respond_to)
|
264
|
+
@methods_to_respond_to = methods_to_respond_to
|
265
|
+
end
|
266
|
+
|
267
|
+
def ===(value)
|
268
|
+
@methods_to_respond_to.all? { |message| value.respond_to?(message) }
|
269
|
+
end
|
270
|
+
|
271
|
+
def description
|
272
|
+
"duck_type(#{@methods_to_respond_to.map(&:inspect).join(', ')})"
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
# @private
|
277
|
+
class InstanceOf
|
278
|
+
def initialize(klass)
|
279
|
+
@klass = klass
|
280
|
+
end
|
281
|
+
|
282
|
+
def ===(actual)
|
283
|
+
actual.instance_of?(@klass)
|
284
|
+
end
|
285
|
+
|
286
|
+
def description
|
287
|
+
"an_instance_of(#{@klass.name})"
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
# @private
|
292
|
+
class KindOf
|
293
|
+
def initialize(klass)
|
294
|
+
@klass = klass
|
295
|
+
end
|
296
|
+
|
297
|
+
def ===(actual)
|
298
|
+
actual.kind_of?(@klass)
|
299
|
+
end
|
300
|
+
|
301
|
+
def description
|
302
|
+
"kind of #{@klass.name}"
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
matcher_namespace = name + '::'
|
307
|
+
::RSpec::Support.register_matcher_definition do |object|
|
308
|
+
# This is the best we have for now. We should tag all of our matchers
|
309
|
+
# with a module or something so we can test for it directly.
|
310
|
+
#
|
311
|
+
# (Note Module#parent in ActiveSupport is defined in a similar way.)
|
312
|
+
begin
|
313
|
+
object.class.name.include?(matcher_namespace)
|
314
|
+
rescue NoMethodError
|
315
|
+
# Some objects, like BasicObject, don't implemented standard
|
316
|
+
# reflection methods.
|
317
|
+
false
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
@@ -0,0 +1,212 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Mocks
|
3
|
+
# Provides configuration options for rspec-mocks.
|
4
|
+
class Configuration
|
5
|
+
def initialize
|
6
|
+
@allow_message_expectations_on_nil = nil
|
7
|
+
@yield_receiver_to_any_instance_implementation_blocks = true
|
8
|
+
@verify_doubled_constant_names = false
|
9
|
+
@transfer_nested_constants = false
|
10
|
+
@verify_partial_doubles = false
|
11
|
+
@temporarily_suppress_partial_double_verification = false
|
12
|
+
@color = false
|
13
|
+
end
|
14
|
+
|
15
|
+
# Sets whether RSpec will warn, ignore, or fail a test when
|
16
|
+
# expectations are set on nil.
|
17
|
+
# By default, when this flag is not set, warning messages are issued when
|
18
|
+
# expectations are set on nil. This is to prevent false-positives and to
|
19
|
+
# catch potential bugs early on.
|
20
|
+
# When set to `true`, warning messages are suppressed.
|
21
|
+
# When set to `false`, it will raise an error.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# RSpec.configure do |config|
|
25
|
+
# config.mock_with :rspec do |mocks|
|
26
|
+
# mocks.allow_message_expectations_on_nil = false
|
27
|
+
# end
|
28
|
+
# end
|
29
|
+
attr_accessor :allow_message_expectations_on_nil
|
30
|
+
|
31
|
+
def yield_receiver_to_any_instance_implementation_blocks?
|
32
|
+
@yield_receiver_to_any_instance_implementation_blocks
|
33
|
+
end
|
34
|
+
|
35
|
+
# Sets whether or not RSpec will yield the receiving instance of a
|
36
|
+
# message to blocks that are used for any_instance stub implementations.
|
37
|
+
# When set, the first yielded argument will be the receiving instance.
|
38
|
+
# Defaults to `true`.
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# RSpec.configure do |rspec|
|
42
|
+
# rspec.mock_with :rspec do |mocks|
|
43
|
+
# mocks.yield_receiver_to_any_instance_implementation_blocks = false
|
44
|
+
# end
|
45
|
+
# end
|
46
|
+
attr_writer :yield_receiver_to_any_instance_implementation_blocks
|
47
|
+
|
48
|
+
# Adds `stub` and `should_receive` to the given
|
49
|
+
# modules or classes. This is usually only necessary
|
50
|
+
# if you application uses some proxy classes that
|
51
|
+
# "strip themselves down" to a bare minimum set of
|
52
|
+
# methods and remove `stub` and `should_receive` in
|
53
|
+
# the process.
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
# RSpec.configure do |rspec|
|
57
|
+
# rspec.mock_with :rspec do |mocks|
|
58
|
+
# mocks.add_stub_and_should_receive_to Delegator
|
59
|
+
# end
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
def add_stub_and_should_receive_to(*modules)
|
63
|
+
modules.each do |mod|
|
64
|
+
Syntax.enable_should(mod)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Provides the ability to set either `expect`,
|
69
|
+
# `should` or both syntaxes. RSpec uses `expect`
|
70
|
+
# syntax by default. This is needed if you want to
|
71
|
+
# explicitly enable `should` syntax and/or explicitly
|
72
|
+
# disable `expect` syntax.
|
73
|
+
#
|
74
|
+
# @example
|
75
|
+
# RSpec.configure do |rspec|
|
76
|
+
# rspec.mock_with :rspec do |mocks|
|
77
|
+
# mocks.syntax = [:expect, :should]
|
78
|
+
# end
|
79
|
+
# end
|
80
|
+
#
|
81
|
+
def syntax=(*values)
|
82
|
+
syntaxes = values.flatten
|
83
|
+
if syntaxes.include?(:expect)
|
84
|
+
Syntax.enable_expect
|
85
|
+
else
|
86
|
+
Syntax.disable_expect
|
87
|
+
end
|
88
|
+
|
89
|
+
if syntaxes.include?(:should)
|
90
|
+
Syntax.enable_should
|
91
|
+
else
|
92
|
+
Syntax.disable_should
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# Returns an array with a list of syntaxes
|
97
|
+
# that are enabled.
|
98
|
+
#
|
99
|
+
# @example
|
100
|
+
# unless RSpec::Mocks.configuration.syntax.include?(:expect)
|
101
|
+
# raise "this RSpec extension gem requires the rspec-mocks `:expect` syntax"
|
102
|
+
# end
|
103
|
+
#
|
104
|
+
def syntax
|
105
|
+
syntaxes = []
|
106
|
+
syntaxes << :should if Syntax.should_enabled?
|
107
|
+
syntaxes << :expect if Syntax.expect_enabled?
|
108
|
+
syntaxes
|
109
|
+
end
|
110
|
+
|
111
|
+
def verify_doubled_constant_names?
|
112
|
+
!!@verify_doubled_constant_names
|
113
|
+
end
|
114
|
+
|
115
|
+
# When this is set to true, an error will be raised when
|
116
|
+
# `instance_double` or `class_double` is given the name of an undefined
|
117
|
+
# constant. You probably only want to set this when running your entire
|
118
|
+
# test suite, with all production code loaded. Setting this for an
|
119
|
+
# isolated unit test will prevent you from being able to isolate it!
|
120
|
+
attr_writer :verify_doubled_constant_names
|
121
|
+
|
122
|
+
# Provides a way to perform customisations when verifying doubles.
|
123
|
+
#
|
124
|
+
# @example
|
125
|
+
# RSpec::Mocks.configuration.before_verifying_doubles do |ref|
|
126
|
+
# ref.some_method!
|
127
|
+
# end
|
128
|
+
def before_verifying_doubles(&block)
|
129
|
+
verifying_double_callbacks << block
|
130
|
+
end
|
131
|
+
alias :when_declaring_verifying_double :before_verifying_doubles
|
132
|
+
|
133
|
+
# @api private
|
134
|
+
# Returns an array of blocks to call when verifying doubles
|
135
|
+
def verifying_double_callbacks
|
136
|
+
@verifying_double_callbacks ||= []
|
137
|
+
end
|
138
|
+
|
139
|
+
def transfer_nested_constants?
|
140
|
+
!!@transfer_nested_constants
|
141
|
+
end
|
142
|
+
|
143
|
+
# Sets the default for the `transfer_nested_constants` option when
|
144
|
+
# stubbing constants.
|
145
|
+
attr_writer :transfer_nested_constants
|
146
|
+
|
147
|
+
# When set to true, partial mocks will be verified the same as object
|
148
|
+
# doubles. Any stubs will have their arguments checked against the original
|
149
|
+
# method, and methods that do not exist cannot be stubbed.
|
150
|
+
def verify_partial_doubles=(val)
|
151
|
+
@verify_partial_doubles = !!val
|
152
|
+
end
|
153
|
+
|
154
|
+
def verify_partial_doubles?
|
155
|
+
@verify_partial_doubles
|
156
|
+
end
|
157
|
+
|
158
|
+
# @private
|
159
|
+
# Used to track wether we are temporarily suppressing verifying partial
|
160
|
+
# doubles with `without_partial_double_verification { ... }`
|
161
|
+
attr_accessor :temporarily_suppress_partial_double_verification
|
162
|
+
|
163
|
+
if ::RSpec.respond_to?(:configuration)
|
164
|
+
def color?
|
165
|
+
::RSpec.configuration.color_enabled?
|
166
|
+
end
|
167
|
+
else
|
168
|
+
# Indicates whether or not diffs should be colored.
|
169
|
+
# Delegates to rspec-core's color option if rspec-core
|
170
|
+
# is loaded; otherwise you can set it here.
|
171
|
+
attr_writer :color
|
172
|
+
|
173
|
+
# Indicates whether or not diffs should be colored.
|
174
|
+
# Delegates to rspec-core's color option if rspec-core
|
175
|
+
# is loaded; otherwise you can set it here.
|
176
|
+
def color?
|
177
|
+
@color
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Monkey-patch `Marshal.dump` to enable dumping of mocked or stubbed
|
182
|
+
# objects. By default this will not work since RSpec mocks works by
|
183
|
+
# adding singleton methods that cannot be serialized. This patch removes
|
184
|
+
# these singleton methods before serialization. Setting to falsey removes
|
185
|
+
# the patch.
|
186
|
+
#
|
187
|
+
# This method is idempotent.
|
188
|
+
def patch_marshal_to_support_partial_doubles=(val)
|
189
|
+
if val
|
190
|
+
RSpec::Mocks::MarshalExtension.patch!
|
191
|
+
else
|
192
|
+
RSpec::Mocks::MarshalExtension.unpatch!
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# @api private
|
197
|
+
# Resets the configured syntax to the default.
|
198
|
+
def reset_syntaxes_to_default
|
199
|
+
self.syntax = [:should, :expect]
|
200
|
+
RSpec::Mocks::Syntax.warn_about_should!
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
# Mocks specific configuration, as distinct from `RSpec.configuration`
|
205
|
+
# which is core RSpec configuration.
|
206
|
+
def self.configuration
|
207
|
+
@configuration ||= Configuration.new
|
208
|
+
end
|
209
|
+
|
210
|
+
configuration.reset_syntaxes_to_default
|
211
|
+
end
|
212
|
+
end
|