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,503 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Mocks
|
3
|
+
# @private
|
4
|
+
class Proxy
|
5
|
+
# @private
|
6
|
+
SpecificMessage = Struct.new(:object, :message, :args) do
|
7
|
+
def ==(expectation)
|
8
|
+
expectation.orig_object == object && expectation.matches?(message, *args)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
unless defined?(Mutex)
|
13
|
+
Support.require_rspec_support 'mutex'
|
14
|
+
Mutex = Support::Mutex
|
15
|
+
end
|
16
|
+
|
17
|
+
# @private
|
18
|
+
def ensure_implemented(*_args)
|
19
|
+
# noop for basic proxies, see VerifyingProxy for behaviour.
|
20
|
+
end
|
21
|
+
|
22
|
+
# @private
|
23
|
+
def initialize(object, order_group, options={})
|
24
|
+
@object = object
|
25
|
+
@order_group = order_group
|
26
|
+
@error_generator = ErrorGenerator.new(object)
|
27
|
+
@messages_received = []
|
28
|
+
@messages_received_mutex = Mutex.new
|
29
|
+
@options = options
|
30
|
+
@null_object = false
|
31
|
+
@method_doubles = Hash.new { |h, k| h[k] = MethodDouble.new(@object, k, self) }
|
32
|
+
end
|
33
|
+
|
34
|
+
# @private
|
35
|
+
attr_reader :object
|
36
|
+
|
37
|
+
# @private
|
38
|
+
def null_object?
|
39
|
+
@null_object
|
40
|
+
end
|
41
|
+
|
42
|
+
# @private
|
43
|
+
# Tells the object to ignore any messages that aren't explicitly set as
|
44
|
+
# stubs or message expectations.
|
45
|
+
def as_null_object
|
46
|
+
@null_object = true
|
47
|
+
@object
|
48
|
+
end
|
49
|
+
|
50
|
+
# @private
|
51
|
+
def original_method_handle_for(_message)
|
52
|
+
nil
|
53
|
+
end
|
54
|
+
|
55
|
+
DEFAULT_MESSAGE_EXPECTATION_OPTS = {}.freeze
|
56
|
+
|
57
|
+
# @private
|
58
|
+
def add_message_expectation(method_name, opts=DEFAULT_MESSAGE_EXPECTATION_OPTS, &block)
|
59
|
+
location = opts.fetch(:expected_from) { CallerFilter.first_non_rspec_line }
|
60
|
+
meth_double = method_double_for(method_name)
|
61
|
+
|
62
|
+
if null_object? && !block
|
63
|
+
meth_double.add_default_stub(@error_generator, @order_group, location, opts) do
|
64
|
+
@object
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
meth_double.add_expectation @error_generator, @order_group, location, opts, &block
|
69
|
+
end
|
70
|
+
|
71
|
+
# @private
|
72
|
+
def add_simple_expectation(method_name, response, location)
|
73
|
+
method_double_for(method_name).add_simple_expectation method_name, response, @error_generator, location
|
74
|
+
end
|
75
|
+
|
76
|
+
# @private
|
77
|
+
def build_expectation(method_name)
|
78
|
+
meth_double = method_double_for(method_name)
|
79
|
+
|
80
|
+
meth_double.build_expectation(
|
81
|
+
@error_generator,
|
82
|
+
@order_group
|
83
|
+
)
|
84
|
+
end
|
85
|
+
|
86
|
+
# @private
|
87
|
+
def replay_received_message_on(expectation, &block)
|
88
|
+
expected_method_name = expectation.message
|
89
|
+
meth_double = method_double_for(expected_method_name)
|
90
|
+
|
91
|
+
if meth_double.expectations.any?
|
92
|
+
@error_generator.raise_expectation_on_mocked_method(expected_method_name)
|
93
|
+
end
|
94
|
+
|
95
|
+
unless null_object? || meth_double.stubs.any?
|
96
|
+
@error_generator.raise_expectation_on_unstubbed_method(expected_method_name)
|
97
|
+
end
|
98
|
+
|
99
|
+
@messages_received_mutex.synchronize do
|
100
|
+
@messages_received.each do |(actual_method_name, args, received_block)|
|
101
|
+
next unless expectation.matches?(actual_method_name, *args)
|
102
|
+
|
103
|
+
expectation.safe_invoke(nil)
|
104
|
+
block.call(*args, &received_block) if block
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# @private
|
110
|
+
def check_for_unexpected_arguments(expectation)
|
111
|
+
@messages_received_mutex.synchronize do
|
112
|
+
return if @messages_received.empty?
|
113
|
+
|
114
|
+
return if @messages_received.any? { |method_name, args, _| expectation.matches?(method_name, *args) }
|
115
|
+
|
116
|
+
name_but_not_args, others = @messages_received.partition do |(method_name, args, _)|
|
117
|
+
expectation.matches_name_but_not_args(method_name, *args)
|
118
|
+
end
|
119
|
+
|
120
|
+
return if name_but_not_args.empty? && !others.empty?
|
121
|
+
|
122
|
+
expectation.raise_unexpected_message_args_error(name_but_not_args.map { |args| args[1] })
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# @private
|
127
|
+
def add_stub(method_name, opts={}, &implementation)
|
128
|
+
location = opts.fetch(:expected_from) { CallerFilter.first_non_rspec_line }
|
129
|
+
method_double_for(method_name).add_stub @error_generator, @order_group, location, opts, &implementation
|
130
|
+
end
|
131
|
+
|
132
|
+
# @private
|
133
|
+
def add_simple_stub(method_name, response)
|
134
|
+
method_double_for(method_name).add_simple_stub method_name, response
|
135
|
+
end
|
136
|
+
|
137
|
+
# @private
|
138
|
+
def remove_stub(method_name)
|
139
|
+
method_double_for(method_name).remove_stub
|
140
|
+
end
|
141
|
+
|
142
|
+
# @private
|
143
|
+
def remove_stub_if_present(method_name)
|
144
|
+
method_double_for(method_name).remove_stub_if_present
|
145
|
+
end
|
146
|
+
|
147
|
+
# @private
|
148
|
+
def verify
|
149
|
+
@method_doubles.each_value { |d| d.verify }
|
150
|
+
end
|
151
|
+
|
152
|
+
# @private
|
153
|
+
def reset
|
154
|
+
@messages_received_mutex.synchronize do
|
155
|
+
@messages_received.clear
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# @private
|
160
|
+
def received_message?(method_name, *args, &block)
|
161
|
+
@messages_received_mutex.synchronize do
|
162
|
+
@messages_received.any? { |array| array == [method_name, args, block] }
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# @private
|
167
|
+
def messages_arg_list
|
168
|
+
@messages_received_mutex.synchronize do
|
169
|
+
@messages_received.map { |_, args, _| args }
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# @private
|
174
|
+
def has_negative_expectation?(message)
|
175
|
+
method_double_for(message).expectations.find { |expectation| expectation.negative_expectation_for?(message) }
|
176
|
+
end
|
177
|
+
|
178
|
+
# @private
|
179
|
+
def record_message_received(message, *args, &block)
|
180
|
+
@order_group.invoked SpecificMessage.new(object, message, args)
|
181
|
+
@messages_received_mutex.synchronize do
|
182
|
+
@messages_received << [message, args, block]
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# @private
|
187
|
+
def message_received(message, *args, &block)
|
188
|
+
record_message_received message, *args, &block
|
189
|
+
|
190
|
+
expectation = find_matching_expectation(message, *args)
|
191
|
+
stub = find_matching_method_stub(message, *args)
|
192
|
+
|
193
|
+
if (stub && expectation && expectation.called_max_times?) || (stub && !expectation)
|
194
|
+
expectation.increase_actual_received_count! if expectation && expectation.actual_received_count_matters?
|
195
|
+
if (expectation = find_almost_matching_expectation(message, *args))
|
196
|
+
expectation.advise(*args) unless expectation.expected_messages_received?
|
197
|
+
end
|
198
|
+
stub.invoke(nil, *args, &block)
|
199
|
+
elsif expectation
|
200
|
+
expectation.unadvise(messages_arg_list)
|
201
|
+
expectation.invoke(stub, *args, &block)
|
202
|
+
elsif (expectation = find_almost_matching_expectation(message, *args))
|
203
|
+
expectation.advise(*args) if null_object? unless expectation.expected_messages_received?
|
204
|
+
|
205
|
+
if null_object? || !has_negative_expectation?(message)
|
206
|
+
expectation.raise_unexpected_message_args_error([args])
|
207
|
+
end
|
208
|
+
elsif (stub = find_almost_matching_stub(message, *args))
|
209
|
+
stub.advise(*args)
|
210
|
+
raise_missing_default_stub_error(stub, [args])
|
211
|
+
elsif Class === @object
|
212
|
+
@object.superclass.__send__(message, *args, &block)
|
213
|
+
else
|
214
|
+
@object.__send__(:method_missing, message, *args, &block)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
# @private
|
219
|
+
def raise_unexpected_message_error(method_name, args)
|
220
|
+
@error_generator.raise_unexpected_message_error method_name, args
|
221
|
+
end
|
222
|
+
|
223
|
+
# @private
|
224
|
+
def raise_missing_default_stub_error(expectation, args_for_multiple_calls)
|
225
|
+
@error_generator.raise_missing_default_stub_error(expectation, args_for_multiple_calls)
|
226
|
+
end
|
227
|
+
|
228
|
+
# @private
|
229
|
+
def visibility_for(_method_name)
|
230
|
+
# This is the default (for test doubles). Subclasses override this.
|
231
|
+
:public
|
232
|
+
end
|
233
|
+
|
234
|
+
if Support::RubyFeatures.module_prepends_supported?
|
235
|
+
def self.prepended_modules_of(klass)
|
236
|
+
ancestors = klass.ancestors
|
237
|
+
|
238
|
+
# `|| 0` is necessary for Ruby 2.0, where the singleton class
|
239
|
+
# is only in the ancestor list when there are prepended modules.
|
240
|
+
singleton_index = ancestors.index(klass) || 0
|
241
|
+
|
242
|
+
ancestors[0, singleton_index]
|
243
|
+
end
|
244
|
+
|
245
|
+
def prepended_modules_of_singleton_class
|
246
|
+
@prepended_modules_of_singleton_class ||= RSpec::Mocks::Proxy.prepended_modules_of(@object.singleton_class)
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
# @private
|
251
|
+
def method_double_if_exists_for_message(message)
|
252
|
+
method_double_for(message) if @method_doubles.key?(message.to_sym)
|
253
|
+
end
|
254
|
+
|
255
|
+
private
|
256
|
+
|
257
|
+
def method_double_for(message)
|
258
|
+
@method_doubles[message.to_sym]
|
259
|
+
end
|
260
|
+
|
261
|
+
def find_matching_expectation(method_name, *args)
|
262
|
+
find_best_matching_expectation_for(method_name) do |expectation|
|
263
|
+
expectation.matches?(method_name, *args)
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
def find_almost_matching_expectation(method_name, *args)
|
268
|
+
find_best_matching_expectation_for(method_name) do |expectation|
|
269
|
+
expectation.matches_name_but_not_args(method_name, *args)
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
def find_best_matching_expectation_for(method_name)
|
274
|
+
first_match = nil
|
275
|
+
|
276
|
+
method_double_for(method_name).expectations.each do |expectation|
|
277
|
+
next unless yield expectation
|
278
|
+
return expectation unless expectation.called_max_times?
|
279
|
+
first_match ||= expectation
|
280
|
+
end
|
281
|
+
|
282
|
+
first_match
|
283
|
+
end
|
284
|
+
|
285
|
+
def find_matching_method_stub(method_name, *args)
|
286
|
+
method_double_for(method_name).stubs.find { |stub| stub.matches?(method_name, *args) }
|
287
|
+
end
|
288
|
+
|
289
|
+
def find_almost_matching_stub(method_name, *args)
|
290
|
+
method_double_for(method_name).stubs.find { |stub| stub.matches_name_but_not_args(method_name, *args) }
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
# @private
|
295
|
+
class TestDoubleProxy < Proxy
|
296
|
+
def reset
|
297
|
+
@method_doubles.clear
|
298
|
+
object.__disallow_further_usage!
|
299
|
+
super
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
# @private
|
304
|
+
class PartialDoubleProxy < Proxy
|
305
|
+
def original_method_handle_for(message)
|
306
|
+
if any_instance_class_recorder_observing_method?(@object.class, message)
|
307
|
+
message = ::RSpec::Mocks.space.
|
308
|
+
any_instance_recorder_for(@object.class).
|
309
|
+
build_alias_method_name(message)
|
310
|
+
end
|
311
|
+
|
312
|
+
::RSpec::Support.method_handle_for(@object, message)
|
313
|
+
rescue NameError
|
314
|
+
nil
|
315
|
+
end
|
316
|
+
|
317
|
+
# @private
|
318
|
+
def add_simple_expectation(method_name, response, location)
|
319
|
+
method_double_for(method_name).configure_method
|
320
|
+
super
|
321
|
+
end
|
322
|
+
|
323
|
+
# @private
|
324
|
+
def add_simple_stub(method_name, response)
|
325
|
+
method_double_for(method_name).configure_method
|
326
|
+
super
|
327
|
+
end
|
328
|
+
|
329
|
+
# @private
|
330
|
+
def visibility_for(method_name)
|
331
|
+
# We fall back to :public because by default we allow undefined methods
|
332
|
+
# to be stubbed, and when we do so, we make them public.
|
333
|
+
MethodReference.method_visibility_for(@object, method_name) || :public
|
334
|
+
end
|
335
|
+
|
336
|
+
def reset
|
337
|
+
@method_doubles.each_value { |d| d.reset }
|
338
|
+
super
|
339
|
+
end
|
340
|
+
|
341
|
+
def message_received(message, *args, &block)
|
342
|
+
RSpec::Mocks.space.any_instance_recorders_from_ancestry_of(object).each do |subscriber|
|
343
|
+
subscriber.notify_received_message(object, message, args, block)
|
344
|
+
end
|
345
|
+
super
|
346
|
+
end
|
347
|
+
|
348
|
+
private
|
349
|
+
|
350
|
+
def any_instance_class_recorder_observing_method?(klass, method_name)
|
351
|
+
only_return_existing = true
|
352
|
+
recorder = ::RSpec::Mocks.space.any_instance_recorder_for(klass, only_return_existing)
|
353
|
+
return true if recorder && recorder.already_observing?(method_name)
|
354
|
+
|
355
|
+
superklass = klass.superclass
|
356
|
+
return false if superklass.nil?
|
357
|
+
any_instance_class_recorder_observing_method?(superklass, method_name)
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
# @private
|
362
|
+
# When we mock or stub a method on a class, we have to treat it a bit different,
|
363
|
+
# because normally singleton method definitions only affect the object on which
|
364
|
+
# they are defined, but on classes they affect subclasses, too. As a result,
|
365
|
+
# we need some special handling to get the original method.
|
366
|
+
module PartialClassDoubleProxyMethods
|
367
|
+
def initialize(source_space, *args)
|
368
|
+
@source_space = source_space
|
369
|
+
super(*args)
|
370
|
+
end
|
371
|
+
|
372
|
+
# Consider this situation:
|
373
|
+
#
|
374
|
+
# class A; end
|
375
|
+
# class B < A; end
|
376
|
+
#
|
377
|
+
# allow(A).to receive(:new)
|
378
|
+
# expect(B).to receive(:new).and_call_original
|
379
|
+
#
|
380
|
+
# When getting the original definition for `B.new`, we cannot rely purely on
|
381
|
+
# using `B.method(:new)` before our redefinition is defined on `B`, because
|
382
|
+
# `B.method(:new)` will return a method that will execute the stubbed version
|
383
|
+
# of the method on `A` since singleton methods on classes are in the lookup
|
384
|
+
# hierarchy.
|
385
|
+
#
|
386
|
+
# To do it properly, we need to find the original definition of `new` from `A`
|
387
|
+
# from _before_ `A` was stubbed, and we need to rebind it to `B` so that it will
|
388
|
+
# run with the proper `self`.
|
389
|
+
#
|
390
|
+
# That's what this method (together with `original_unbound_method_handle_from_ancestor_for`)
|
391
|
+
# does.
|
392
|
+
def original_method_handle_for(message)
|
393
|
+
unbound_method = superclass_proxy &&
|
394
|
+
superclass_proxy.original_unbound_method_handle_from_ancestor_for(message.to_sym)
|
395
|
+
|
396
|
+
return super unless unbound_method
|
397
|
+
unbound_method.bind(object)
|
398
|
+
# :nocov:
|
399
|
+
rescue TypeError
|
400
|
+
if RUBY_VERSION == '1.8.7'
|
401
|
+
# In MRI 1.8.7, a singleton method on a class cannot be rebound to its subclass
|
402
|
+
if unbound_method && unbound_method.owner.ancestors.first != unbound_method.owner
|
403
|
+
# This is a singleton method; we can't do anything with it
|
404
|
+
# But we can work around this using a different implementation
|
405
|
+
double = method_double_from_ancestor_for(message)
|
406
|
+
return object.method(double.method_stasher.stashed_method_name)
|
407
|
+
end
|
408
|
+
end
|
409
|
+
raise
|
410
|
+
# :nocov:
|
411
|
+
end
|
412
|
+
|
413
|
+
protected
|
414
|
+
|
415
|
+
def original_unbound_method_handle_from_ancestor_for(message)
|
416
|
+
double = method_double_from_ancestor_for(message)
|
417
|
+
double && double.original_method.unbind
|
418
|
+
end
|
419
|
+
|
420
|
+
def method_double_from_ancestor_for(message)
|
421
|
+
@method_doubles.fetch(message) do
|
422
|
+
# The fact that there is no method double for this message indicates
|
423
|
+
# that it has not been redefined by rspec-mocks. We need to continue
|
424
|
+
# looking up the ancestor chain.
|
425
|
+
return superclass_proxy &&
|
426
|
+
superclass_proxy.method_double_from_ancestor_for(message)
|
427
|
+
end
|
428
|
+
end
|
429
|
+
|
430
|
+
def superclass_proxy
|
431
|
+
return @superclass_proxy if defined?(@superclass_proxy)
|
432
|
+
|
433
|
+
if (superclass = object.superclass)
|
434
|
+
@superclass_proxy = @source_space.superclass_proxy_for(superclass)
|
435
|
+
else
|
436
|
+
@superclass_proxy = nil
|
437
|
+
end
|
438
|
+
end
|
439
|
+
end
|
440
|
+
|
441
|
+
# @private
|
442
|
+
class PartialClassDoubleProxy < PartialDoubleProxy
|
443
|
+
include PartialClassDoubleProxyMethods
|
444
|
+
end
|
445
|
+
|
446
|
+
# @private
|
447
|
+
class ProxyForNil < PartialDoubleProxy
|
448
|
+
def initialize(order_group)
|
449
|
+
set_expectation_behavior
|
450
|
+
super(nil, order_group)
|
451
|
+
end
|
452
|
+
|
453
|
+
attr_accessor :disallow_expectations
|
454
|
+
attr_accessor :warn_about_expectations
|
455
|
+
|
456
|
+
def add_message_expectation(method_name, opts={}, &block)
|
457
|
+
warn_or_raise!(method_name)
|
458
|
+
super
|
459
|
+
end
|
460
|
+
|
461
|
+
def add_stub(method_name, opts={}, &implementation)
|
462
|
+
warn_or_raise!(method_name)
|
463
|
+
super
|
464
|
+
end
|
465
|
+
|
466
|
+
private
|
467
|
+
|
468
|
+
def set_expectation_behavior
|
469
|
+
case RSpec::Mocks.configuration.allow_message_expectations_on_nil
|
470
|
+
when false
|
471
|
+
@warn_about_expectations = false
|
472
|
+
@disallow_expectations = true
|
473
|
+
when true
|
474
|
+
@warn_about_expectations = false
|
475
|
+
@disallow_expectations = false
|
476
|
+
else
|
477
|
+
@warn_about_expectations = true
|
478
|
+
@disallow_expectations = false
|
479
|
+
end
|
480
|
+
end
|
481
|
+
|
482
|
+
def warn_or_raise!(method_name)
|
483
|
+
# This method intentionally swallows the message when
|
484
|
+
# neither disallow_expectations nor warn_about_expectations
|
485
|
+
# are set to true.
|
486
|
+
if disallow_expectations
|
487
|
+
raise_error(method_name)
|
488
|
+
elsif warn_about_expectations
|
489
|
+
warn(method_name)
|
490
|
+
end
|
491
|
+
end
|
492
|
+
|
493
|
+
def warn(method_name)
|
494
|
+
warning_msg = @error_generator.expectation_on_nil_message(method_name)
|
495
|
+
RSpec.warning(warning_msg)
|
496
|
+
end
|
497
|
+
|
498
|
+
def raise_error(method_name)
|
499
|
+
@error_generator.raise_expectation_on_nil_error(method_name)
|
500
|
+
end
|
501
|
+
end
|
502
|
+
end
|
503
|
+
end
|