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,114 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Matchers
|
3
|
+
module BuiltIn
|
4
|
+
# @api private
|
5
|
+
# Provides the implementation for `have_attributes`.
|
6
|
+
# Not intended to be instantiated directly.
|
7
|
+
class HaveAttributes < BaseMatcher
|
8
|
+
# @private
|
9
|
+
attr_reader :respond_to_failed
|
10
|
+
|
11
|
+
def initialize(expected)
|
12
|
+
@expected = expected
|
13
|
+
@values = {}
|
14
|
+
@respond_to_failed = false
|
15
|
+
@negated = false
|
16
|
+
end
|
17
|
+
|
18
|
+
# @private
|
19
|
+
def actual
|
20
|
+
@values
|
21
|
+
end
|
22
|
+
|
23
|
+
# @api private
|
24
|
+
# @return [Boolean]
|
25
|
+
def matches?(actual)
|
26
|
+
@actual = actual
|
27
|
+
@negated = false
|
28
|
+
return false unless respond_to_attributes?
|
29
|
+
perform_match(:all?)
|
30
|
+
end
|
31
|
+
|
32
|
+
# @api private
|
33
|
+
# @return [Boolean]
|
34
|
+
def does_not_match?(actual)
|
35
|
+
@actual = actual
|
36
|
+
@negated = true
|
37
|
+
return false unless respond_to_attributes?
|
38
|
+
perform_match(:none?)
|
39
|
+
end
|
40
|
+
|
41
|
+
# @api private
|
42
|
+
# @return [String]
|
43
|
+
def description
|
44
|
+
described_items = surface_descriptions_in(expected)
|
45
|
+
improve_hash_formatting "have attributes #{RSpec::Support::ObjectFormatter.format(described_items)}"
|
46
|
+
end
|
47
|
+
|
48
|
+
# @api private
|
49
|
+
# @return [Boolean]
|
50
|
+
def diffable?
|
51
|
+
!@respond_to_failed && !@negated
|
52
|
+
end
|
53
|
+
|
54
|
+
# @api private
|
55
|
+
# @return [String]
|
56
|
+
def failure_message
|
57
|
+
respond_to_failure_message_or do
|
58
|
+
"expected #{actual_formatted} to #{description} but had attributes #{ formatted_values }"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# @api private
|
63
|
+
# @return [String]
|
64
|
+
def failure_message_when_negated
|
65
|
+
respond_to_failure_message_or { "expected #{actual_formatted} not to #{description}" }
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def cache_all_values
|
71
|
+
@values = {}
|
72
|
+
expected.each do |attribute_key, _attribute_value|
|
73
|
+
actual_value = @actual.__send__(attribute_key)
|
74
|
+
@values[attribute_key] = actual_value
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def perform_match(predicate)
|
79
|
+
cache_all_values
|
80
|
+
expected.__send__(predicate) do |attribute_key, attribute_value|
|
81
|
+
actual_has_attribute?(attribute_key, attribute_value)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def actual_has_attribute?(attribute_key, attribute_value)
|
86
|
+
values_match?(attribute_value, @values.fetch(attribute_key))
|
87
|
+
end
|
88
|
+
|
89
|
+
def respond_to_attributes?
|
90
|
+
matches = respond_to_matcher.matches?(@actual)
|
91
|
+
@respond_to_failed = !matches
|
92
|
+
matches
|
93
|
+
end
|
94
|
+
|
95
|
+
def respond_to_matcher
|
96
|
+
@respond_to_matcher ||= RespondTo.new(*expected.keys).with(0).arguments
|
97
|
+
end
|
98
|
+
|
99
|
+
def respond_to_failure_message_or
|
100
|
+
if respond_to_failed
|
101
|
+
respond_to_matcher.failure_message
|
102
|
+
else
|
103
|
+
improve_hash_formatting(yield)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def formatted_values
|
108
|
+
values = RSpec::Support::ObjectFormatter.format(@values)
|
109
|
+
improve_hash_formatting(values)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/include.rb
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Matchers
|
3
|
+
module BuiltIn
|
4
|
+
# @api private
|
5
|
+
# Provides the implementation for `include`.
|
6
|
+
# Not intended to be instantiated directly.
|
7
|
+
class Include < BaseMatcher
|
8
|
+
# @private
|
9
|
+
attr_reader :expecteds
|
10
|
+
|
11
|
+
def initialize(*expecteds)
|
12
|
+
@expecteds = expecteds
|
13
|
+
end
|
14
|
+
|
15
|
+
# @api private
|
16
|
+
# @return [Boolean]
|
17
|
+
def matches?(actual)
|
18
|
+
actual = actual.to_hash if convert_to_hash?(actual)
|
19
|
+
perform_match(actual) { |v| v }
|
20
|
+
end
|
21
|
+
|
22
|
+
# @api private
|
23
|
+
# @return [Boolean]
|
24
|
+
def does_not_match?(actual)
|
25
|
+
actual = actual.to_hash if convert_to_hash?(actual)
|
26
|
+
perform_match(actual) { |v| !v }
|
27
|
+
end
|
28
|
+
|
29
|
+
# @api private
|
30
|
+
# @return [String]
|
31
|
+
def description
|
32
|
+
improve_hash_formatting("include#{readable_list_of(expecteds)}")
|
33
|
+
end
|
34
|
+
|
35
|
+
# @api private
|
36
|
+
# @return [String]
|
37
|
+
def failure_message
|
38
|
+
format_failure_message("to") { super }
|
39
|
+
end
|
40
|
+
|
41
|
+
# @api private
|
42
|
+
# @return [String]
|
43
|
+
def failure_message_when_negated
|
44
|
+
format_failure_message("not to") { super }
|
45
|
+
end
|
46
|
+
|
47
|
+
# @api private
|
48
|
+
# @return [Boolean]
|
49
|
+
def diffable?
|
50
|
+
!diff_would_wrongly_highlight_matched_item?
|
51
|
+
end
|
52
|
+
|
53
|
+
# @api private
|
54
|
+
# @return [Array, Hash]
|
55
|
+
def expected
|
56
|
+
if expecteds.one? && Hash === expecteds.first
|
57
|
+
expecteds.first
|
58
|
+
else
|
59
|
+
expecteds
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def format_failure_message(preposition)
|
66
|
+
if actual.respond_to?(:include?)
|
67
|
+
improve_hash_formatting("expected #{description_of @actual} #{preposition} include#{readable_list_of @divergent_items}")
|
68
|
+
else
|
69
|
+
improve_hash_formatting(yield) + ", but it does not respond to `include?`"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def readable_list_of(items)
|
74
|
+
described_items = surface_descriptions_in(items)
|
75
|
+
if described_items.all? { |item| item.is_a?(Hash) }
|
76
|
+
" #{described_items.inject(:merge).inspect}"
|
77
|
+
else
|
78
|
+
EnglishPhrasing.list(described_items)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def perform_match(actual, &block)
|
83
|
+
@actual = actual
|
84
|
+
@divergent_items = excluded_from_actual(&block)
|
85
|
+
actual.respond_to?(:include?) && @divergent_items.empty?
|
86
|
+
end
|
87
|
+
|
88
|
+
def excluded_from_actual
|
89
|
+
return [] unless @actual.respond_to?(:include?)
|
90
|
+
|
91
|
+
expecteds.inject([]) do |memo, expected_item|
|
92
|
+
if comparing_hash_to_a_subset?(expected_item)
|
93
|
+
expected_item.each do |(key, value)|
|
94
|
+
memo << { key => value } unless yield actual_hash_includes?(key, value)
|
95
|
+
end
|
96
|
+
elsif comparing_hash_keys?(expected_item)
|
97
|
+
memo << expected_item unless yield actual_hash_has_key?(expected_item)
|
98
|
+
else
|
99
|
+
memo << expected_item unless yield actual_collection_includes?(expected_item)
|
100
|
+
end
|
101
|
+
memo
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def comparing_hash_to_a_subset?(expected_item)
|
106
|
+
actual.is_a?(Hash) && expected_item.is_a?(Hash)
|
107
|
+
end
|
108
|
+
|
109
|
+
def actual_hash_includes?(expected_key, expected_value)
|
110
|
+
actual_value = actual.fetch(expected_key) { return false }
|
111
|
+
values_match?(expected_value, actual_value)
|
112
|
+
end
|
113
|
+
|
114
|
+
def comparing_hash_keys?(expected_item)
|
115
|
+
actual.is_a?(Hash) && !expected_item.is_a?(Hash)
|
116
|
+
end
|
117
|
+
|
118
|
+
def actual_hash_has_key?(expected_key)
|
119
|
+
# We check `key?` first for perf:
|
120
|
+
# `key?` is O(1), but `any?` is O(N).
|
121
|
+
actual.key?(expected_key) ||
|
122
|
+
actual.keys.any? { |key| values_match?(expected_key, key) }
|
123
|
+
end
|
124
|
+
|
125
|
+
def actual_collection_includes?(expected_item)
|
126
|
+
return true if actual.include?(expected_item)
|
127
|
+
|
128
|
+
# String lacks an `any?` method...
|
129
|
+
return false unless actual.respond_to?(:any?)
|
130
|
+
|
131
|
+
actual.any? { |value| values_match?(expected_item, value) }
|
132
|
+
end
|
133
|
+
|
134
|
+
def diff_would_wrongly_highlight_matched_item?
|
135
|
+
return false unless actual.is_a?(String) && expected.is_a?(Array)
|
136
|
+
|
137
|
+
lines = actual.split("\n")
|
138
|
+
expected.any? do |str|
|
139
|
+
actual.include?(str) && lines.none? { |line| line == str }
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
def convert_to_hash?(obj)
|
144
|
+
!obj.respond_to?(:include?) && obj.respond_to?(:to_hash)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/match.rb
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Matchers
|
3
|
+
module BuiltIn
|
4
|
+
# @api private
|
5
|
+
# Provides the implementation for `match`.
|
6
|
+
# Not intended to be instantiated directly.
|
7
|
+
class Match < BaseMatcher
|
8
|
+
def initialize(expected)
|
9
|
+
super(expected)
|
10
|
+
|
11
|
+
@expected_captures = nil
|
12
|
+
end
|
13
|
+
# @api private
|
14
|
+
# @return [String]
|
15
|
+
def description
|
16
|
+
if @expected_captures && @expected.match(actual)
|
17
|
+
"match #{surface_descriptions_in(expected).inspect} with captures #{surface_descriptions_in(@expected_captures).inspect}"
|
18
|
+
else
|
19
|
+
"match #{surface_descriptions_in(expected).inspect}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# @api private
|
24
|
+
# @return [Boolean]
|
25
|
+
def diffable?
|
26
|
+
true
|
27
|
+
end
|
28
|
+
|
29
|
+
# Used to specify the captures we match against
|
30
|
+
# @return [self]
|
31
|
+
def with_captures(*captures)
|
32
|
+
@expected_captures = captures
|
33
|
+
self
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def match(expected, actual)
|
39
|
+
return match_captures(expected, actual) if @expected_captures
|
40
|
+
return true if values_match?(expected, actual)
|
41
|
+
return false unless can_safely_call_match?(expected, actual)
|
42
|
+
actual.match(expected)
|
43
|
+
end
|
44
|
+
|
45
|
+
def can_safely_call_match?(expected, actual)
|
46
|
+
return false unless actual.respond_to?(:match)
|
47
|
+
|
48
|
+
!(RSpec::Matchers.is_a_matcher?(expected) &&
|
49
|
+
(String === actual || Regexp === actual))
|
50
|
+
end
|
51
|
+
|
52
|
+
def match_captures(expected, actual)
|
53
|
+
match = actual.match(expected)
|
54
|
+
if match
|
55
|
+
match = ReliableMatchData.new(match)
|
56
|
+
if match.names.empty?
|
57
|
+
values_match?(@expected_captures, match.captures)
|
58
|
+
else
|
59
|
+
expected_matcher = @expected_captures.last
|
60
|
+
values_match?(expected_matcher, Hash[match.names.zip(match.captures)]) ||
|
61
|
+
values_match?(expected_matcher, Hash[match.names.map(&:to_sym).zip(match.captures)]) ||
|
62
|
+
values_match?(@expected_captures, match.captures)
|
63
|
+
end
|
64
|
+
else
|
65
|
+
false
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# @api private
|
71
|
+
# Used to wrap match data and make it reliable for 1.8.7
|
72
|
+
class ReliableMatchData
|
73
|
+
def initialize(match_data)
|
74
|
+
@match_data = match_data
|
75
|
+
end
|
76
|
+
|
77
|
+
if RUBY_VERSION == "1.8.7"
|
78
|
+
# @api private
|
79
|
+
# Returns match data names for named captures
|
80
|
+
# @return Array
|
81
|
+
def names
|
82
|
+
[]
|
83
|
+
end
|
84
|
+
else
|
85
|
+
# @api private
|
86
|
+
# Returns match data names for named captures
|
87
|
+
# @return Array
|
88
|
+
def names
|
89
|
+
match_data.names
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# @api private
|
94
|
+
# returns an array of captures from the match data
|
95
|
+
# @return Array
|
96
|
+
def captures
|
97
|
+
match_data.captures
|
98
|
+
end
|
99
|
+
|
100
|
+
protected
|
101
|
+
|
102
|
+
attr_reader :match_data
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/operators.rb
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
require 'rspec/support'
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Matchers
|
5
|
+
module BuiltIn
|
6
|
+
# @api private
|
7
|
+
# Provides the implementation for operator matchers.
|
8
|
+
# Not intended to be instantiated directly.
|
9
|
+
# Only available for use with `should`.
|
10
|
+
class OperatorMatcher
|
11
|
+
class << self
|
12
|
+
# @private
|
13
|
+
def registry
|
14
|
+
@registry ||= {}
|
15
|
+
end
|
16
|
+
|
17
|
+
# @private
|
18
|
+
def register(klass, operator, matcher)
|
19
|
+
registry[klass] ||= {}
|
20
|
+
registry[klass][operator] = matcher
|
21
|
+
end
|
22
|
+
|
23
|
+
# @private
|
24
|
+
def unregister(klass, operator)
|
25
|
+
registry[klass] && registry[klass].delete(operator)
|
26
|
+
end
|
27
|
+
|
28
|
+
# @private
|
29
|
+
def get(klass, operator)
|
30
|
+
klass.ancestors.each do |ancestor|
|
31
|
+
matcher = registry[ancestor] && registry[ancestor][operator]
|
32
|
+
return matcher if matcher
|
33
|
+
end
|
34
|
+
|
35
|
+
nil
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
register Enumerable, '=~', BuiltIn::ContainExactly
|
40
|
+
|
41
|
+
def initialize(actual)
|
42
|
+
@actual = actual
|
43
|
+
end
|
44
|
+
|
45
|
+
# @private
|
46
|
+
def self.use_custom_matcher_or_delegate(operator)
|
47
|
+
define_method(operator) do |expected|
|
48
|
+
if !has_non_generic_implementation_of?(operator) && (matcher = OperatorMatcher.get(@actual.class, operator))
|
49
|
+
@actual.__send__(::RSpec::Matchers.last_expectation_handler.should_method, matcher.new(expected))
|
50
|
+
else
|
51
|
+
eval_match(@actual, operator, expected)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
negative_operator = operator.sub(/^=/, '!')
|
56
|
+
if negative_operator != operator && respond_to?(negative_operator)
|
57
|
+
define_method(negative_operator) do |_expected|
|
58
|
+
opposite_should = ::RSpec::Matchers.last_expectation_handler.opposite_should_method
|
59
|
+
raise "RSpec does not support `#{::RSpec::Matchers.last_expectation_handler.should_method} #{negative_operator} expected`. " \
|
60
|
+
"Use `#{opposite_should} #{operator} expected` instead."
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
['==', '===', '=~', '>', '>=', '<', '<='].each do |operator|
|
66
|
+
use_custom_matcher_or_delegate operator
|
67
|
+
end
|
68
|
+
|
69
|
+
# @private
|
70
|
+
def fail_with_message(message)
|
71
|
+
RSpec::Expectations.fail_with(message, @expected, @actual)
|
72
|
+
end
|
73
|
+
|
74
|
+
# @api private
|
75
|
+
# @return [String]
|
76
|
+
def description
|
77
|
+
"#{@operator} #{RSpec::Support::ObjectFormatter.format(@expected)}"
|
78
|
+
end
|
79
|
+
|
80
|
+
private
|
81
|
+
|
82
|
+
def has_non_generic_implementation_of?(op)
|
83
|
+
Support.method_handle_for(@actual, op).owner != ::Kernel
|
84
|
+
rescue NameError
|
85
|
+
false
|
86
|
+
end
|
87
|
+
|
88
|
+
def eval_match(actual, operator, expected)
|
89
|
+
::RSpec::Matchers.last_matcher = self
|
90
|
+
@operator, @expected = operator, expected
|
91
|
+
__delegate_operator(actual, operator, expected)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# @private
|
96
|
+
# Handles operator matcher for `should`.
|
97
|
+
class PositiveOperatorMatcher < OperatorMatcher
|
98
|
+
def __delegate_operator(actual, operator, expected)
|
99
|
+
if actual.__send__(operator, expected)
|
100
|
+
true
|
101
|
+
else
|
102
|
+
expected_formatted = RSpec::Support::ObjectFormatter.format(expected)
|
103
|
+
actual_formatted = RSpec::Support::ObjectFormatter.format(actual)
|
104
|
+
|
105
|
+
if ['==', '===', '=~'].include?(operator)
|
106
|
+
fail_with_message("expected: #{expected_formatted}\n got: #{actual_formatted} (using #{operator})")
|
107
|
+
else
|
108
|
+
fail_with_message("expected: #{operator} #{expected_formatted}\n got: #{operator.gsub(/./, ' ')} #{actual_formatted}")
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
# @private
|
115
|
+
# Handles operator matcher for `should_not`.
|
116
|
+
class NegativeOperatorMatcher < OperatorMatcher
|
117
|
+
def __delegate_operator(actual, operator, expected)
|
118
|
+
return false unless actual.__send__(operator, expected)
|
119
|
+
|
120
|
+
expected_formatted = RSpec::Support::ObjectFormatter.format(expected)
|
121
|
+
actual_formatted = RSpec::Support::ObjectFormatter.format(actual)
|
122
|
+
|
123
|
+
fail_with_message("expected not: #{operator} #{expected_formatted}\n got: #{operator.gsub(/./, ' ')} #{actual_formatted}")
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
data/vendor/bundle/ruby/2.5.0/gems/rspec-expectations-3.9.0/lib/rspec/matchers/built_in/output.rb
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
require 'stringio'
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Matchers
|
5
|
+
module BuiltIn
|
6
|
+
# @api private
|
7
|
+
# Provides the implementation for `output`.
|
8
|
+
# Not intended to be instantiated directly.
|
9
|
+
class Output < BaseMatcher
|
10
|
+
def initialize(expected)
|
11
|
+
@expected = expected
|
12
|
+
@actual = ""
|
13
|
+
@block = nil
|
14
|
+
@stream_capturer = NullCapture
|
15
|
+
end
|
16
|
+
|
17
|
+
def matches?(block)
|
18
|
+
@block = block
|
19
|
+
return false unless Proc === block
|
20
|
+
@actual = @stream_capturer.capture(block)
|
21
|
+
@expected ? values_match?(@expected, @actual) : captured?
|
22
|
+
end
|
23
|
+
|
24
|
+
def does_not_match?(block)
|
25
|
+
!matches?(block) && Proc === block
|
26
|
+
end
|
27
|
+
|
28
|
+
# @api public
|
29
|
+
# Tells the matcher to match against stdout.
|
30
|
+
# Works only when the main Ruby process prints to stdout
|
31
|
+
def to_stdout
|
32
|
+
@stream_capturer = CaptureStdout
|
33
|
+
self
|
34
|
+
end
|
35
|
+
|
36
|
+
# @api public
|
37
|
+
# Tells the matcher to match against stderr.
|
38
|
+
# Works only when the main Ruby process prints to stderr
|
39
|
+
def to_stderr
|
40
|
+
@stream_capturer = CaptureStderr
|
41
|
+
self
|
42
|
+
end
|
43
|
+
|
44
|
+
# @api public
|
45
|
+
# Tells the matcher to match against stdout.
|
46
|
+
# Works when subprocesses print to stdout as well.
|
47
|
+
# This is significantly (~30x) slower than `to_stdout`
|
48
|
+
def to_stdout_from_any_process
|
49
|
+
@stream_capturer = CaptureStreamToTempfile.new("stdout", $stdout)
|
50
|
+
self
|
51
|
+
end
|
52
|
+
|
53
|
+
# @api public
|
54
|
+
# Tells the matcher to match against stderr.
|
55
|
+
# Works when subprocesses print to stderr as well.
|
56
|
+
# This is significantly (~30x) slower than `to_stderr`
|
57
|
+
def to_stderr_from_any_process
|
58
|
+
@stream_capturer = CaptureStreamToTempfile.new("stderr", $stderr)
|
59
|
+
self
|
60
|
+
end
|
61
|
+
|
62
|
+
# @api private
|
63
|
+
# @return [String]
|
64
|
+
def failure_message
|
65
|
+
"expected block to #{description}, but #{positive_failure_reason}"
|
66
|
+
end
|
67
|
+
|
68
|
+
# @api private
|
69
|
+
# @return [String]
|
70
|
+
def failure_message_when_negated
|
71
|
+
"expected block to not #{description}, but #{negative_failure_reason}"
|
72
|
+
end
|
73
|
+
|
74
|
+
# @api private
|
75
|
+
# @return [String]
|
76
|
+
def description
|
77
|
+
if @expected
|
78
|
+
"output #{description_of @expected} to #{@stream_capturer.name}"
|
79
|
+
else
|
80
|
+
"output to #{@stream_capturer.name}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# @api private
|
85
|
+
# @return [Boolean]
|
86
|
+
def diffable?
|
87
|
+
true
|
88
|
+
end
|
89
|
+
|
90
|
+
# @api private
|
91
|
+
# Indicates this matcher matches against a block.
|
92
|
+
# @return [True]
|
93
|
+
def supports_block_expectations?
|
94
|
+
true
|
95
|
+
end
|
96
|
+
|
97
|
+
private
|
98
|
+
|
99
|
+
def captured?
|
100
|
+
@actual.length > 0
|
101
|
+
end
|
102
|
+
|
103
|
+
def positive_failure_reason
|
104
|
+
return "was not a block" unless Proc === @block
|
105
|
+
return "output #{actual_output_description}" if @expected
|
106
|
+
"did not"
|
107
|
+
end
|
108
|
+
|
109
|
+
def negative_failure_reason
|
110
|
+
return "was not a block" unless Proc === @block
|
111
|
+
"output #{actual_output_description}"
|
112
|
+
end
|
113
|
+
|
114
|
+
def actual_output_description
|
115
|
+
return "nothing" unless captured?
|
116
|
+
actual_formatted
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# @private
|
121
|
+
module NullCapture
|
122
|
+
def self.name
|
123
|
+
"some stream"
|
124
|
+
end
|
125
|
+
|
126
|
+
def self.capture(_block)
|
127
|
+
raise "You must chain `to_stdout` or `to_stderr` off of the `output(...)` matcher."
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
# @private
|
132
|
+
module CaptureStdout
|
133
|
+
def self.name
|
134
|
+
'stdout'
|
135
|
+
end
|
136
|
+
|
137
|
+
def self.capture(block)
|
138
|
+
captured_stream = StringIO.new
|
139
|
+
|
140
|
+
original_stream = $stdout
|
141
|
+
$stdout = captured_stream
|
142
|
+
|
143
|
+
block.call
|
144
|
+
|
145
|
+
captured_stream.string
|
146
|
+
ensure
|
147
|
+
$stdout = original_stream
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# @private
|
152
|
+
module CaptureStderr
|
153
|
+
def self.name
|
154
|
+
'stderr'
|
155
|
+
end
|
156
|
+
|
157
|
+
def self.capture(block)
|
158
|
+
captured_stream = StringIO.new
|
159
|
+
|
160
|
+
original_stream = $stderr
|
161
|
+
$stderr = captured_stream
|
162
|
+
|
163
|
+
block.call
|
164
|
+
|
165
|
+
captured_stream.string
|
166
|
+
ensure
|
167
|
+
$stderr = original_stream
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# @private
|
172
|
+
class CaptureStreamToTempfile < Struct.new(:name, :stream)
|
173
|
+
def capture(block)
|
174
|
+
# We delay loading tempfile until it is actually needed because
|
175
|
+
# we want to minimize stdlibs loaded so that users who use a
|
176
|
+
# portion of the stdlib can't have passing specs while forgetting
|
177
|
+
# to load it themselves. `CaptureStreamToTempfile` is rarely used
|
178
|
+
# and `tempfile` pulls in a bunch of things (delegate, tmpdir,
|
179
|
+
# thread, fileutils, etc), so it's worth delaying it until this point.
|
180
|
+
require 'tempfile'
|
181
|
+
|
182
|
+
original_stream = stream.clone
|
183
|
+
captured_stream = Tempfile.new(name)
|
184
|
+
|
185
|
+
begin
|
186
|
+
captured_stream.sync = true
|
187
|
+
stream.reopen(captured_stream)
|
188
|
+
block.call
|
189
|
+
captured_stream.rewind
|
190
|
+
captured_stream.read
|
191
|
+
ensure
|
192
|
+
stream.reopen(original_stream)
|
193
|
+
captured_stream.close
|
194
|
+
captured_stream.unlink
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|