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,339 @@
|
|
1
|
+
RSpec::Support.require_rspec_support 'recursive_const_methods'
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Mocks
|
5
|
+
# Provides information about constants that may (or may not)
|
6
|
+
# have been mutated by rspec-mocks.
|
7
|
+
class Constant
|
8
|
+
extend Support::RecursiveConstMethods
|
9
|
+
|
10
|
+
# @api private
|
11
|
+
def initialize(name)
|
12
|
+
@name = name
|
13
|
+
@previously_defined = false
|
14
|
+
@stubbed = false
|
15
|
+
@hidden = false
|
16
|
+
@valid_name = true
|
17
|
+
yield self if block_given?
|
18
|
+
end
|
19
|
+
|
20
|
+
# @return [String] The fully qualified name of the constant.
|
21
|
+
attr_reader :name
|
22
|
+
|
23
|
+
# @return [Object, nil] The original value (e.g. before it
|
24
|
+
# was mutated by rspec-mocks) of the constant, or
|
25
|
+
# nil if the constant was not previously defined.
|
26
|
+
attr_accessor :original_value
|
27
|
+
|
28
|
+
# @private
|
29
|
+
attr_writer :previously_defined, :stubbed, :hidden, :valid_name
|
30
|
+
|
31
|
+
# @return [Boolean] Whether or not the constant was defined
|
32
|
+
# before the current example.
|
33
|
+
def previously_defined?
|
34
|
+
@previously_defined
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [Boolean] Whether or not rspec-mocks has mutated
|
38
|
+
# (stubbed or hidden) this constant.
|
39
|
+
def mutated?
|
40
|
+
@stubbed || @hidden
|
41
|
+
end
|
42
|
+
|
43
|
+
# @return [Boolean] Whether or not rspec-mocks has stubbed
|
44
|
+
# this constant.
|
45
|
+
def stubbed?
|
46
|
+
@stubbed
|
47
|
+
end
|
48
|
+
|
49
|
+
# @return [Boolean] Whether or not rspec-mocks has hidden
|
50
|
+
# this constant.
|
51
|
+
def hidden?
|
52
|
+
@hidden
|
53
|
+
end
|
54
|
+
|
55
|
+
# @return [Boolean] Whether or not the provided constant name
|
56
|
+
# is a valid Ruby constant name.
|
57
|
+
def valid_name?
|
58
|
+
@valid_name
|
59
|
+
end
|
60
|
+
|
61
|
+
# The default `to_s` isn't very useful, so a custom version is provided.
|
62
|
+
def to_s
|
63
|
+
"#<#{self.class.name} #{name}>"
|
64
|
+
end
|
65
|
+
alias inspect to_s
|
66
|
+
|
67
|
+
# @private
|
68
|
+
def self.unmutated(name)
|
69
|
+
previously_defined = recursive_const_defined?(name)
|
70
|
+
rescue NameError
|
71
|
+
new(name) do |c|
|
72
|
+
c.valid_name = false
|
73
|
+
end
|
74
|
+
else
|
75
|
+
new(name) do |const|
|
76
|
+
const.previously_defined = previously_defined
|
77
|
+
const.original_value = recursive_const_get(name) if previously_defined
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Queries rspec-mocks to find out information about the named constant.
|
82
|
+
#
|
83
|
+
# @param [String] name the name of the constant
|
84
|
+
# @return [Constant] an object contaning information about the named
|
85
|
+
# constant.
|
86
|
+
def self.original(name)
|
87
|
+
mutator = ::RSpec::Mocks.space.constant_mutator_for(name)
|
88
|
+
mutator ? mutator.to_constant : unmutated(name)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Provides a means to stub constants.
|
93
|
+
class ConstantMutator
|
94
|
+
extend Support::RecursiveConstMethods
|
95
|
+
|
96
|
+
# Stubs a constant.
|
97
|
+
#
|
98
|
+
# @param (see ExampleMethods#stub_const)
|
99
|
+
# @option (see ExampleMethods#stub_const)
|
100
|
+
# @return (see ExampleMethods#stub_const)
|
101
|
+
#
|
102
|
+
# @see ExampleMethods#stub_const
|
103
|
+
# @note It's recommended that you use `stub_const` in your
|
104
|
+
# examples. This is an alternate public API that is provided
|
105
|
+
# so you can stub constants in other contexts (e.g. helper
|
106
|
+
# classes).
|
107
|
+
def self.stub(constant_name, value, options={})
|
108
|
+
unless String === constant_name
|
109
|
+
raise ArgumentError, "`stub_const` requires a String, but you provided a #{constant_name.class.name}"
|
110
|
+
end
|
111
|
+
|
112
|
+
mutator = if recursive_const_defined?(constant_name, &raise_on_invalid_const)
|
113
|
+
DefinedConstantReplacer
|
114
|
+
else
|
115
|
+
UndefinedConstantSetter
|
116
|
+
end
|
117
|
+
|
118
|
+
mutate(mutator.new(constant_name, value, options[:transfer_nested_constants]))
|
119
|
+
value
|
120
|
+
end
|
121
|
+
|
122
|
+
# Hides a constant.
|
123
|
+
#
|
124
|
+
# @param (see ExampleMethods#hide_const)
|
125
|
+
#
|
126
|
+
# @see ExampleMethods#hide_const
|
127
|
+
# @note It's recommended that you use `hide_const` in your
|
128
|
+
# examples. This is an alternate public API that is provided
|
129
|
+
# so you can hide constants in other contexts (e.g. helper
|
130
|
+
# classes).
|
131
|
+
def self.hide(constant_name)
|
132
|
+
mutate(ConstantHider.new(constant_name, nil, {}))
|
133
|
+
nil
|
134
|
+
end
|
135
|
+
|
136
|
+
# Contains common functionality used by all of the constant mutators.
|
137
|
+
#
|
138
|
+
# @private
|
139
|
+
class BaseMutator
|
140
|
+
include Support::RecursiveConstMethods
|
141
|
+
|
142
|
+
attr_reader :original_value, :full_constant_name
|
143
|
+
|
144
|
+
def initialize(full_constant_name, mutated_value, transfer_nested_constants)
|
145
|
+
@full_constant_name = normalize_const_name(full_constant_name)
|
146
|
+
@mutated_value = mutated_value
|
147
|
+
@transfer_nested_constants = transfer_nested_constants
|
148
|
+
@context_parts = @full_constant_name.split('::')
|
149
|
+
@const_name = @context_parts.pop
|
150
|
+
@reset_performed = false
|
151
|
+
end
|
152
|
+
|
153
|
+
def to_constant
|
154
|
+
const = Constant.new(full_constant_name)
|
155
|
+
const.original_value = original_value
|
156
|
+
|
157
|
+
const
|
158
|
+
end
|
159
|
+
|
160
|
+
def idempotently_reset
|
161
|
+
reset unless @reset_performed
|
162
|
+
@reset_performed = true
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Hides a defined constant for the duration of an example.
|
167
|
+
#
|
168
|
+
# @private
|
169
|
+
class ConstantHider < BaseMutator
|
170
|
+
def mutate
|
171
|
+
return unless (@defined = recursive_const_defined?(full_constant_name))
|
172
|
+
@context = recursive_const_get(@context_parts.join('::'))
|
173
|
+
@original_value = get_const_defined_on(@context, @const_name)
|
174
|
+
|
175
|
+
@context.__send__(:remove_const, @const_name)
|
176
|
+
end
|
177
|
+
|
178
|
+
def to_constant
|
179
|
+
return Constant.unmutated(full_constant_name) unless @defined
|
180
|
+
|
181
|
+
const = super
|
182
|
+
const.hidden = true
|
183
|
+
const.previously_defined = true
|
184
|
+
|
185
|
+
const
|
186
|
+
end
|
187
|
+
|
188
|
+
def reset
|
189
|
+
return unless @defined
|
190
|
+
@context.const_set(@const_name, @original_value)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# Replaces a defined constant for the duration of an example.
|
195
|
+
#
|
196
|
+
# @private
|
197
|
+
class DefinedConstantReplacer < BaseMutator
|
198
|
+
def initialize(*args)
|
199
|
+
super
|
200
|
+
@constants_to_transfer = []
|
201
|
+
end
|
202
|
+
|
203
|
+
def mutate
|
204
|
+
@context = recursive_const_get(@context_parts.join('::'))
|
205
|
+
@original_value = get_const_defined_on(@context, @const_name)
|
206
|
+
|
207
|
+
@constants_to_transfer = verify_constants_to_transfer!
|
208
|
+
|
209
|
+
@context.__send__(:remove_const, @const_name)
|
210
|
+
@context.const_set(@const_name, @mutated_value)
|
211
|
+
|
212
|
+
transfer_nested_constants
|
213
|
+
end
|
214
|
+
|
215
|
+
def to_constant
|
216
|
+
const = super
|
217
|
+
const.stubbed = true
|
218
|
+
const.previously_defined = true
|
219
|
+
|
220
|
+
const
|
221
|
+
end
|
222
|
+
|
223
|
+
def reset
|
224
|
+
@constants_to_transfer.each do |const|
|
225
|
+
@mutated_value.__send__(:remove_const, const)
|
226
|
+
end
|
227
|
+
|
228
|
+
@context.__send__(:remove_const, @const_name)
|
229
|
+
@context.const_set(@const_name, @original_value)
|
230
|
+
end
|
231
|
+
|
232
|
+
def transfer_nested_constants
|
233
|
+
@constants_to_transfer.each do |const|
|
234
|
+
@mutated_value.const_set(const, get_const_defined_on(original_value, const))
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
def verify_constants_to_transfer!
|
239
|
+
return [] unless should_transfer_nested_constants?
|
240
|
+
|
241
|
+
{ @original_value => "the original value", @mutated_value => "the stubbed value" }.each do |value, description|
|
242
|
+
next if value.respond_to?(:constants)
|
243
|
+
|
244
|
+
raise ArgumentError,
|
245
|
+
"Cannot transfer nested constants for #{@full_constant_name} " \
|
246
|
+
"since #{description} is not a class or module and only classes " \
|
247
|
+
"and modules support nested constants."
|
248
|
+
end
|
249
|
+
|
250
|
+
if Array === @transfer_nested_constants
|
251
|
+
@transfer_nested_constants = @transfer_nested_constants.map(&:to_s) if RUBY_VERSION == '1.8.7'
|
252
|
+
undefined_constants = @transfer_nested_constants - constants_defined_on(@original_value)
|
253
|
+
|
254
|
+
if undefined_constants.any?
|
255
|
+
available_constants = constants_defined_on(@original_value) - @transfer_nested_constants
|
256
|
+
raise ArgumentError,
|
257
|
+
"Cannot transfer nested constant(s) #{undefined_constants.join(' and ')} " \
|
258
|
+
"for #{@full_constant_name} since they are not defined. Did you mean " \
|
259
|
+
"#{available_constants.join(' or ')}?"
|
260
|
+
end
|
261
|
+
|
262
|
+
@transfer_nested_constants
|
263
|
+
else
|
264
|
+
constants_defined_on(@original_value)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
def should_transfer_nested_constants?
|
269
|
+
return true if @transfer_nested_constants
|
270
|
+
return false unless RSpec::Mocks.configuration.transfer_nested_constants?
|
271
|
+
@original_value.respond_to?(:constants) && @mutated_value.respond_to?(:constants)
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
# Sets an undefined constant for the duration of an example.
|
276
|
+
#
|
277
|
+
# @private
|
278
|
+
class UndefinedConstantSetter < BaseMutator
|
279
|
+
def mutate
|
280
|
+
@parent = @context_parts.inject(Object) do |klass, name|
|
281
|
+
if const_defined_on?(klass, name)
|
282
|
+
get_const_defined_on(klass, name)
|
283
|
+
else
|
284
|
+
ConstantMutator.stub(name_for(klass, name), Module.new)
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
@parent.const_set(@const_name, @mutated_value)
|
289
|
+
end
|
290
|
+
|
291
|
+
def to_constant
|
292
|
+
const = super
|
293
|
+
const.stubbed = true
|
294
|
+
const.previously_defined = false
|
295
|
+
|
296
|
+
const
|
297
|
+
end
|
298
|
+
|
299
|
+
def reset
|
300
|
+
@parent.__send__(:remove_const, @const_name)
|
301
|
+
end
|
302
|
+
|
303
|
+
private
|
304
|
+
|
305
|
+
def name_for(parent, name)
|
306
|
+
root = if parent == Object
|
307
|
+
''
|
308
|
+
else
|
309
|
+
parent.name
|
310
|
+
end
|
311
|
+
root + '::' + name
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
# Uses the mutator to mutate (stub or hide) a constant. Ensures that
|
316
|
+
# the mutator is correctly registered so it can be backed out at the end
|
317
|
+
# of the test.
|
318
|
+
#
|
319
|
+
# @private
|
320
|
+
def self.mutate(mutator)
|
321
|
+
::RSpec::Mocks.space.register_constant_mutator(mutator)
|
322
|
+
mutator.mutate
|
323
|
+
end
|
324
|
+
|
325
|
+
# Used internally by the constant stubbing to raise a helpful
|
326
|
+
# error when a constant like "A::B::C" is stubbed and A::B is
|
327
|
+
# not a module (and thus, it's impossible to define "A::B::C"
|
328
|
+
# since only modules can have nested constants).
|
329
|
+
#
|
330
|
+
# @api private
|
331
|
+
def self.raise_on_invalid_const
|
332
|
+
lambda do |const_name, failed_name|
|
333
|
+
raise "Cannot stub constant #{failed_name} on #{const_name} " \
|
334
|
+
"since #{const_name} is not a module."
|
335
|
+
end
|
336
|
+
end
|
337
|
+
end
|
338
|
+
end
|
339
|
+
end
|
@@ -0,0 +1,149 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Mocks
|
3
|
+
# @private
|
4
|
+
class ObjectReference
|
5
|
+
# Returns an appropriate Object or Module reference based
|
6
|
+
# on the given argument.
|
7
|
+
def self.for(object_module_or_name, allow_direct_object_refs=false)
|
8
|
+
case object_module_or_name
|
9
|
+
when Module
|
10
|
+
if anonymous_module?(object_module_or_name)
|
11
|
+
DirectObjectReference.new(object_module_or_name)
|
12
|
+
else
|
13
|
+
# Use a `NamedObjectReference` if it has a name because this
|
14
|
+
# will use the original value of the constant in case it has
|
15
|
+
# been stubbed.
|
16
|
+
NamedObjectReference.new(name_of(object_module_or_name))
|
17
|
+
end
|
18
|
+
when String
|
19
|
+
NamedObjectReference.new(object_module_or_name)
|
20
|
+
else
|
21
|
+
if allow_direct_object_refs
|
22
|
+
DirectObjectReference.new(object_module_or_name)
|
23
|
+
else
|
24
|
+
raise ArgumentError,
|
25
|
+
"Module or String expected, got #{object_module_or_name.inspect}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
if Module.new.name.nil?
|
31
|
+
def self.anonymous_module?(mod)
|
32
|
+
!name_of(mod)
|
33
|
+
end
|
34
|
+
else # 1.8.7
|
35
|
+
def self.anonymous_module?(mod)
|
36
|
+
name_of(mod) == ""
|
37
|
+
end
|
38
|
+
end
|
39
|
+
private_class_method :anonymous_module?
|
40
|
+
|
41
|
+
def self.name_of(mod)
|
42
|
+
MODULE_NAME_METHOD.bind(mod).call
|
43
|
+
end
|
44
|
+
private_class_method :name_of
|
45
|
+
|
46
|
+
# @private
|
47
|
+
MODULE_NAME_METHOD = Module.instance_method(:name)
|
48
|
+
end
|
49
|
+
|
50
|
+
# An implementation of rspec-mocks' reference interface.
|
51
|
+
# Used when an object is passed to {ExampleMethods#object_double}, or
|
52
|
+
# an anonymous class or module is passed to {ExampleMethods#instance_double}
|
53
|
+
# or {ExampleMethods#class_double}.
|
54
|
+
# Represents a reference to that object.
|
55
|
+
# @see NamedObjectReference
|
56
|
+
class DirectObjectReference
|
57
|
+
# @param object [Object] the object to which this refers
|
58
|
+
def initialize(object)
|
59
|
+
@object = object
|
60
|
+
end
|
61
|
+
|
62
|
+
# @return [String] the object's description (via `#inspect`).
|
63
|
+
def description
|
64
|
+
@object.inspect
|
65
|
+
end
|
66
|
+
|
67
|
+
# Defined for interface parity with the other object reference
|
68
|
+
# implementations. Raises an `ArgumentError` to indicate that `as_stubbed_const`
|
69
|
+
# is invalid when passing an object argument to `object_double`.
|
70
|
+
def const_to_replace
|
71
|
+
raise ArgumentError,
|
72
|
+
"Can not perform constant replacement with an anonymous object."
|
73
|
+
end
|
74
|
+
|
75
|
+
# The target of the verifying double (the object itself).
|
76
|
+
#
|
77
|
+
# @return [Object]
|
78
|
+
def target
|
79
|
+
@object
|
80
|
+
end
|
81
|
+
|
82
|
+
# Always returns true for an object as the class is defined.
|
83
|
+
#
|
84
|
+
# @return [true]
|
85
|
+
def defined?
|
86
|
+
true
|
87
|
+
end
|
88
|
+
|
89
|
+
# Yields if the reference target is loaded, providing a generic mechanism
|
90
|
+
# to optionally run a bit of code only when a reference's target is
|
91
|
+
# loaded.
|
92
|
+
#
|
93
|
+
# This specific implementation always yields because direct references
|
94
|
+
# are always loaded.
|
95
|
+
#
|
96
|
+
# @yield [Object] the target of this reference.
|
97
|
+
def when_loaded
|
98
|
+
yield @object
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# An implementation of rspec-mocks' reference interface.
|
103
|
+
# Used when a string is passed to {ExampleMethods#object_double},
|
104
|
+
# and when a string, named class or named module is passed to
|
105
|
+
# {ExampleMethods#instance_double}, or {ExampleMethods#class_double}.
|
106
|
+
# Represents a reference to the object named (via a constant lookup)
|
107
|
+
# by the string.
|
108
|
+
# @see DirectObjectReference
|
109
|
+
class NamedObjectReference
|
110
|
+
# @param const_name [String] constant name
|
111
|
+
def initialize(const_name)
|
112
|
+
@const_name = const_name
|
113
|
+
end
|
114
|
+
|
115
|
+
# @return [Boolean] true if the named constant is defined, false otherwise.
|
116
|
+
def defined?
|
117
|
+
!!object
|
118
|
+
end
|
119
|
+
|
120
|
+
# @return [String] the constant name to replace with a double.
|
121
|
+
def const_to_replace
|
122
|
+
@const_name
|
123
|
+
end
|
124
|
+
alias description const_to_replace
|
125
|
+
|
126
|
+
# @return [Object, nil] the target of the verifying double (the named object), or
|
127
|
+
# nil if it is not defined.
|
128
|
+
def target
|
129
|
+
object
|
130
|
+
end
|
131
|
+
|
132
|
+
# Yields if the reference target is loaded, providing a generic mechanism
|
133
|
+
# to optionally run a bit of code only when a reference's target is
|
134
|
+
# loaded.
|
135
|
+
#
|
136
|
+
# @yield [Object] the target object
|
137
|
+
def when_loaded
|
138
|
+
yield object if object
|
139
|
+
end
|
140
|
+
|
141
|
+
private
|
142
|
+
|
143
|
+
def object
|
144
|
+
return @object if defined?(@object)
|
145
|
+
@object = Constant.original(@const_name).original_value
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Mocks
|
3
|
+
# @private
|
4
|
+
class OrderGroup
|
5
|
+
def initialize
|
6
|
+
@expectations = []
|
7
|
+
@invocation_order = []
|
8
|
+
@index = 0
|
9
|
+
end
|
10
|
+
|
11
|
+
# @private
|
12
|
+
def register(expectation)
|
13
|
+
@expectations << expectation
|
14
|
+
end
|
15
|
+
|
16
|
+
def invoked(message)
|
17
|
+
@invocation_order << message
|
18
|
+
end
|
19
|
+
|
20
|
+
# @private
|
21
|
+
def ready_for?(expectation)
|
22
|
+
remaining_expectations.find(&:ordered?) == expectation
|
23
|
+
end
|
24
|
+
|
25
|
+
# @private
|
26
|
+
def consume
|
27
|
+
remaining_expectations.each_with_index do |expectation, index|
|
28
|
+
next unless expectation.ordered?
|
29
|
+
|
30
|
+
@index += index + 1
|
31
|
+
return expectation
|
32
|
+
end
|
33
|
+
nil
|
34
|
+
end
|
35
|
+
|
36
|
+
# @private
|
37
|
+
def handle_order_constraint(expectation)
|
38
|
+
return unless expectation.ordered? && remaining_expectations.include?(expectation)
|
39
|
+
return consume if ready_for?(expectation)
|
40
|
+
expectation.raise_out_of_order_error
|
41
|
+
end
|
42
|
+
|
43
|
+
def verify_invocation_order(expectation)
|
44
|
+
expectation.raise_out_of_order_error unless expectations_invoked_in_order?
|
45
|
+
true
|
46
|
+
end
|
47
|
+
|
48
|
+
def clear
|
49
|
+
@index = 0
|
50
|
+
@invocation_order.clear
|
51
|
+
@expectations.clear
|
52
|
+
end
|
53
|
+
|
54
|
+
def empty?
|
55
|
+
@expectations.empty?
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def remaining_expectations
|
61
|
+
@expectations[@index..-1] || []
|
62
|
+
end
|
63
|
+
|
64
|
+
def expectations_invoked_in_order?
|
65
|
+
invoked_expectations == expected_invocations
|
66
|
+
end
|
67
|
+
|
68
|
+
def invoked_expectations
|
69
|
+
@expectations.select { |e| e.ordered? && @invocation_order.include?(e) }
|
70
|
+
end
|
71
|
+
|
72
|
+
def expected_invocations
|
73
|
+
@invocation_order.map { |invocation| expectation_for(invocation) }.compact
|
74
|
+
end
|
75
|
+
|
76
|
+
def expectation_for(message)
|
77
|
+
@expectations.find { |e| message == e }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|