syllable_counter 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/README.md +5 -2
- data/lib/syllable_counter.rb +7 -19
- data/lib/syllable_counter/calculate.rb +28 -0
- data/lib/syllable_counter/english_exceptions.rb +11 -0
- data/lib/syllable_counter/rules.rb +71 -0
- data/lib/syllable_counter/version.rb +1 -1
- data/spec/calculator_spec.rb +27 -0
- data/spec/rules_spec.rb +39 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/syllable_counter_spec.rb +6 -75
- data/syllable_counter.gemspec +2 -2
- data/vendor/bundle/bin/autospec +23 -0
- data/vendor/bundle/bin/htmldiff +25 -0
- data/vendor/bundle/bin/ldiff +25 -0
- data/vendor/bundle/bin/rake +23 -0
- data/vendor/bundle/bin/rspec +23 -0
- data/vendor/bundle/build_info/diff-lcs-1.2.4.info +1 -0
- data/vendor/bundle/build_info/rake-10.1.0.info +1 -0
- data/vendor/bundle/build_info/rspec-2.14.1.info +1 -0
- data/vendor/bundle/build_info/rspec-core-2.14.5.info +1 -0
- data/vendor/bundle/build_info/rspec-expectations-2.14.2.info +1 -0
- data/vendor/bundle/build_info/rspec-mocks-2.14.3.info +1 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/.autotest +3 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/.gemtest +0 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/.hoerc +2 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/.rspec +2 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/.travis.yml +22 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/Contributing.rdoc +64 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/Gemfile +20 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/History.rdoc +146 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/License.rdoc +39 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/Manifest.txt +38 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/README.rdoc +85 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/Rakefile +39 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/autotest/discover.rb +1 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/bin/htmldiff +32 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/bin/ldiff +6 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/docs/COPYING.txt +339 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/docs/artistic.txt +127 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff-lcs.rb +3 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs.rb +805 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs/array.rb +7 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs/block.rb +37 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs/callbacks.rb +322 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs/change.rb +177 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs/htmldiff.rb +149 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs/hunk.rb +276 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs/internals.rb +301 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs/ldiff.rb +195 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/lib/diff/lcs/string.rb +5 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/change_spec.rb +65 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/diff_spec.rb +47 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/hunk_spec.rb +72 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/issues_spec.rb +24 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/lcs_spec.rb +54 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/patch_spec.rb +414 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/sdiff_spec.rb +202 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/spec_helper.rb +290 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/traverse_balanced_spec.rb +310 -0
- data/vendor/bundle/gems/diff-lcs-1.2.4/spec/traverse_sequences_spec.rb +139 -0
- data/vendor/bundle/gems/rake-10.1.0/.gemtest +0 -0
- data/vendor/bundle/gems/rake-10.1.0/CHANGES +530 -0
- data/vendor/bundle/gems/rake-10.1.0/MIT-LICENSE +21 -0
- data/vendor/bundle/gems/rake-10.1.0/README.rdoc +187 -0
- data/vendor/bundle/gems/rake-10.1.0/Rakefile +375 -0
- data/vendor/bundle/gems/rake-10.1.0/TODO +21 -0
- data/vendor/bundle/gems/rake-10.1.0/bin/rake +33 -0
- data/vendor/bundle/gems/rake-10.1.0/install.rb +80 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake.rb +73 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/alt_system.rb +108 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/application.rb +728 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/backtrace.rb +20 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/clean.rb +55 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/cloneable.rb +16 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/contrib/compositepublisher.rb +21 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/contrib/ftptools.rb +139 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/contrib/publisher.rb +73 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/contrib/rubyforgepublisher.rb +16 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/contrib/sshpublisher.rb +50 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/contrib/sys.rb +2 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/default_loader.rb +10 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/dsl_definition.rb +157 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/early_time.rb +18 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/ext/core.rb +28 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/ext/module.rb +0 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/ext/string.rb +166 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/ext/time.rb +15 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/file_creation_task.rb +24 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/file_list.rb +416 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/file_task.rb +46 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/file_utils.rb +116 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/file_utils_ext.rb +144 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/gempackagetask.rb +2 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/invocation_chain.rb +57 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/linked_list.rb +103 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/loaders/makefile.rb +40 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/multi_task.rb +13 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/name_space.rb +25 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/packagetask.rb +190 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/pathmap.rb +1 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/phony.rb +15 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/private_reader.rb +20 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/promise.rb +99 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/pseudo_status.rb +29 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/rake_module.rb +37 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/rake_test_loader.rb +22 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/rdoctask.rb +2 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/ruby182_test_unit_fix.rb +27 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/runtest.rb +22 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/scope.rb +42 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/task.rb +378 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/task_argument_error.rb +7 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/task_arguments.rb +89 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/task_manager.rb +297 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/tasklib.rb +22 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/testtask.rb +201 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/thread_history_display.rb +48 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/thread_pool.rb +161 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/trace_output.rb +22 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/version.rb +9 -0
- data/vendor/bundle/gems/rake-10.1.0/lib/rake/win32.rb +56 -0
- data/vendor/bundle/gems/rake-10.1.0/test/file_creation.rb +34 -0
- data/vendor/bundle/gems/rake-10.1.0/test/helper.rb +128 -0
- data/vendor/bundle/gems/rake-10.1.0/test/support/rakefile_definitions.rb +444 -0
- data/vendor/bundle/gems/rake-10.1.0/test/support/ruby_runner.rb +33 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_private_reader.rb +42 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake.rb +40 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_application.rb +517 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_application_options.rb +457 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_backtrace.rb +113 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_clean.rb +46 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_definitions.rb +79 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_directory_task.rb +57 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_dsl.rb +40 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_early_time.rb +31 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_extension.rb +59 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_file_creation_task.rb +56 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_file_list.rb +627 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_file_list_path_map.rb +8 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_file_task.rb +122 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_file_utils.rb +309 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_ftp_file.rb +74 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_functional.rb +466 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_invocation_chain.rb +64 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_linked_list.rb +84 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_makefile_loader.rb +46 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_multi_task.rb +58 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_name_space.rb +43 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_package_task.rb +79 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_path_map.rb +168 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_path_map_explode.rb +34 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_path_map_partial.rb +18 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_pseudo_status.rb +21 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_rake_test_loader.rb +20 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_reduce_compat.rb +26 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_require.rb +40 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_rules.rb +362 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_scope.rb +44 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_task.rb +376 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_task_argument_parsing.rb +103 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_task_arguments.rb +121 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_task_lib.rb +9 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_task_manager.rb +158 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_task_with_arguments.rb +171 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_test_task.rb +119 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_thread_pool.rb +142 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_top_level_functions.rb +71 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_rake_win32.rb +72 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_thread_history_display.rb +101 -0
- data/vendor/bundle/gems/rake-10.1.0/test/test_trace_output.rb +52 -0
- data/vendor/bundle/gems/rspec-2.14.1/License.txt +24 -0
- data/vendor/bundle/gems/rspec-2.14.1/README.md +47 -0
- data/vendor/bundle/gems/rspec-2.14.1/lib/rspec.rb +3 -0
- data/vendor/bundle/gems/rspec-2.14.1/lib/rspec/version.rb +5 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/.document +5 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/.yardopts +6 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/Changelog.md +881 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/License.txt +24 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/README.md +261 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/exe/autospec +13 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/exe/rspec +25 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/Autotest.md +38 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/README.md +17 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/Upgrade.md +364 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/README.md +28 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/example_name_option.feature +97 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/exit_status.feature +82 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/format_option.feature +75 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/init.feature +18 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/line_number_appended_to_path.feature +140 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/line_number_option.feature +58 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/order.feature +29 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/pattern_option.feature +49 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/rake_task.feature +122 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/require_option.feature +43 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/ruby.feature +22 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/tag.feature +98 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/command_line/warnings_option.feature +29 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/alias_example_to.feature +48 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/backtrace_clean_patterns.feature +102 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/custom_settings.feature +84 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/default_path.feature +38 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/deprecation_stream.feature +58 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/fail_fast.feature +77 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/failure_exit_code.feature +36 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/order_and_seed.feature +3 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/output_stream.feature +24 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/pattern.feature +38 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/profile.feature +220 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/read_options_from_file.feature +90 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/run_all_when_everything_filtered.feature +76 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/show_failures_in_pending_blocks.feature +61 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/configuration/treat_symbols_as_metadata_keys_with_true_values.feature +52 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/example_groups/basic_structure.feature +55 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/example_groups/shared_context.feature +74 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/example_groups/shared_examples.feature +294 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/expectation_framework_integration/configure_expectation_framework.feature +102 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/filtering/exclusion_filters.feature +138 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/filtering/if_and_unless.feature +168 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/filtering/inclusion_filters.feature +105 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/formatters/configurable_colors.feature +31 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/formatters/custom_formatter.feature +36 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/formatters/json_formatter.feature +30 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/formatters/text_formatter.feature +46 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/helper_methods/arbitrary_methods.feature +40 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/helper_methods/let.feature +50 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/helper_methods/modules.feature +149 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/hooks/around_hooks.feature +343 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/hooks/before_and_after_hooks.feature +427 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/hooks/filtering.feature +234 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/metadata/current_example.feature +17 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/metadata/described_class.feature +17 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/metadata/user_defined.feature +113 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/mock_framework_integration/use_any_framework.feature +106 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/mock_framework_integration/use_flexmock.feature +96 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/mock_framework_integration/use_mocha.feature +97 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/mock_framework_integration/use_rr.feature +98 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/mock_framework_integration/use_rspec.feature +97 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/pending/pending_examples.feature +229 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/spec_files/arbitrary_file_suffix.feature +13 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/step_definitions/additional_cli_steps.rb +49 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/subject/attribute_of_subject.feature +124 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/subject/explicit_subject.feature +101 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/subject/implicit_receiver.feature +29 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/subject/implicit_subject.feature +63 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/support/env.rb +14 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/features/support/rubinius.rb +6 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/autotest/discover.rb +1 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/autotest/rspec2.rb +73 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/autorun.rb +2 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core.rb +169 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/backtrace_cleaner.rb +46 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/backward_compatibility.rb +55 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/command_line.rb +36 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/configuration.rb +1174 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/configuration_options.rb +156 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/deprecation.rb +31 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/drb_command_line.rb +26 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/drb_options.rb +87 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/dsl.rb +26 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/example.rb +331 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb +479 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/extensions/instance_eval_with_args.rb +44 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/extensions/kernel.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/extensions/module_eval_with_args.rb +38 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/extensions/ordered.rb +27 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/filter_manager.rb +203 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters.rb +55 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/base_formatter.rb +246 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/base_text_formatter.rb +329 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/deprecation_formatter.rb +39 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/documentation_formatter.rb +67 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/helpers.rb +110 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/html_formatter.rb +155 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/html_printer.rb +408 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/json_formatter.rb +70 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/progress_formatter.rb +32 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/snippet_extractor.rb +92 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/formatters/text_mate_formatter.rb +34 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/hooks.rb +519 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/memoized_helpers.rb +514 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/metadata.rb +299 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/metadata_hash_builder.rb +97 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/mocking/with_absolutely_nothing.rb +11 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/mocking/with_flexmock.rb +27 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/mocking/with_mocha.rb +52 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/mocking/with_rr.rb +27 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/mocking/with_rspec.rb +27 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/option_parser.rb +219 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/pending.rb +109 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/project_initializer.rb +86 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/rake_task.rb +206 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/reporter.rb +132 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/ruby_project.rb +44 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/runner.rb +87 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/shared_context.rb +55 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/shared_example_group.rb +185 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/shared_example_group/collection.rb +43 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/version.rb +8 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/lib/rspec/core/world.rb +127 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/autotest/discover_spec.rb +19 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/autotest/failed_results_re_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/autotest/rspec_spec.rb +133 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/command_line/order_spec.rb +204 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/backtrace_cleaner_spec.rb +68 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/command_line_spec.rb +108 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/command_line_spec_output.txt +0 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/configuration_options_spec.rb +417 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/configuration_spec.rb +1561 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/deprecation_spec.rb +46 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/deprecations_spec.rb +73 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/drb_command_line_spec.rb +102 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/drb_options_spec.rb +193 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/dsl_spec.rb +25 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/example_group_spec.rb +1187 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/example_spec.rb +439 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/filter_manager_spec.rb +246 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/base_formatter_spec.rb +108 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/base_text_formatter_spec.rb +494 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/deprecation_formatter_spec.rb +96 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/documentation_formatter_spec.rb +88 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/helpers_spec.rb +94 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +404 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/html_formatted-1.8.7-rbx.html +477 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/html_formatted-1.8.7.html +414 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/html_formatted-1.9.2.html +425 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/html_formatted-1.9.3-jruby.html +404 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/html_formatted-1.9.3-rbx.html +477 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/html_formatted-1.9.3.html +425 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/html_formatted-2.0.0.html +425 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/html_formatter_spec.rb +95 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/json_formatter_spec.rb +115 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/progress_formatter_spec.rb +30 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/snippet_extractor_spec.rb +26 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +395 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/text_mate_formatted-1.8.7-rbx.html +477 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +414 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +425 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/text_mate_formatted-1.9.3-jruby.html +404 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/text_mate_formatted-1.9.3-rbx.html +477 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/text_mate_formatted-1.9.3.html +425 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/text_mate_formatted-2.0.0.html +425 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/formatters/text_mate_formatter_spec.rb +96 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/hooks_filtering_spec.rb +227 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/hooks_spec.rb +267 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/kernel_extensions_spec.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/memoized_helpers_spec.rb +688 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/metadata_spec.rb +491 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/option_parser_spec.rb +242 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/pending_example_spec.rb +220 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/project_initializer_spec.rb +130 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/rake_task_spec.rb +181 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/reporter_spec.rb +141 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/resources/a_bar.rb +0 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/resources/a_foo.rb +0 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/resources/a_spec.rb +1 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/resources/custom_example_group_runner.rb +14 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/resources/formatter_specs.rb +60 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/resources/utf8_encoded.rb +8 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/rspec_matchers_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/ruby_project_spec.rb +26 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/runner_spec.rb +82 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/shared_context_spec.rb +114 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/shared_example_group/collection_spec.rb +70 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/shared_example_group_spec.rb +120 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core/world_spec.rb +142 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/rspec/core_spec.rb +74 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/spec_helper.rb +132 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/support/config_options_helper.rb +15 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/support/helper_methods.rb +36 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/support/isolate_load_path_mutation.rb +6 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/support/isolated_directory.rb +10 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/support/isolated_home_directory.rb +16 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/support/matchers.rb +65 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/support/sandboxed_mock_space.rb +100 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/support/shared_example_groups.rb +41 -0
- data/vendor/bundle/gems/rspec-core-2.14.5/spec/support/spec_files.rb +44 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/.document +5 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/.yardopts +6 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/Changelog.md +399 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/License.txt +23 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/README.md +184 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/README.md +48 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/Upgrade.md +53 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/README.md +90 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/be.feature +175 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/be_within.feature +48 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/cover.feature +47 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/end_with.feature +48 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/equality.feature +139 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/exist.feature +45 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/expect_change.feature +59 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/expect_error.feature +144 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/have.feature +109 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/include.feature +174 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/match.feature +52 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/operators.feature +227 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/predicates.feature +137 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/respond_to.feature +84 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/satisfy.feature +33 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/start_with.feature +48 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/throw_symbol.feature +91 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/types.feature +116 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/yield.feature +161 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/custom_matchers/access_running_example.feature +53 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/custom_matchers/define_diffable_matcher.feature +27 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/custom_matchers/define_matcher.feature +368 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/custom_matchers/define_matcher_outside_rspec.feature +38 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/custom_matchers/define_matcher_with_fluent_interface.feature +24 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/customized_message.feature +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/diffing.feature +85 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/implicit_docstrings.feature +52 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/step_definitions/additional_cli_steps.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/support/env.rb +14 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/support/rubinius.rb +6 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/syntax_configuration.feature +71 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/features/test_frameworks/test_unit.feature +44 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec-expectations.rb +1 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations.rb +47 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/deprecation.rb +17 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/differ.rb +140 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/errors.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/expectation_target.rb +87 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/extensions.rb +2 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/extensions/array.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/extensions/object.rb +29 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/fail_with.rb +79 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/handler.rb +68 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/syntax.rb +164 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/expectations/version.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers.rb +697 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/be_close.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in.rb +39 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/base_matcher.rb +68 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/be.rb +197 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/be_instance_of.rb +15 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/be_kind_of.rb +11 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/be_within.rb +55 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/change.rb +141 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/cover.rb +21 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/eq.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/eql.rb +23 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/equal.rb +48 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/exist.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/has.rb +48 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/have.rb +124 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/include.rb +61 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/match.rb +12 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/match_array.rb +51 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/raise_error.rb +123 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/respond_to.rb +74 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/satisfy.rb +30 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/start_and_end_with.rb +48 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/throw_symbol.rb +94 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/built_in/yield.rb +296 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/compatibility.rb +14 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/configuration.rb +108 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/dsl.rb +24 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/extensions/instance_eval_with_args.rb +39 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/generated_descriptions.rb +35 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/matcher.rb +300 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/method_missing.rb +12 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/operator_matcher.rb +109 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/pretty.rb +70 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/lib/rspec/matchers/test_unit_integration.rb +11 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/expectations/differ_spec.rb +203 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/expectations/expectation_target_spec.rb +82 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/expectations/extensions/kernel_spec.rb +67 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/expectations/fail_with_spec.rb +114 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/expectations/handler_spec.rb +227 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/expectations/syntax_spec.rb +139 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/base_matcher_spec.rb +62 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/be_close_spec.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/be_instance_of_spec.rb +63 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/be_kind_of_spec.rb +41 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/be_spec.rb +522 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/be_within_spec.rb +137 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/change_spec.rb +567 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/configuration_spec.rb +206 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/cover_spec.rb +69 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/description_generation_spec.rb +190 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/dsl_spec.rb +57 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/eq_spec.rb +60 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/eql_spec.rb +41 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/equal_spec.rb +78 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/exist_spec.rb +124 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/has_spec.rb +122 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/have_spec.rb +455 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/include_matcher_integration_spec.rb +30 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/include_spec.rb +531 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/match_array_spec.rb +194 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/match_spec.rb +61 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/matcher_spec.rb +471 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/matchers_spec.rb +37 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/method_missing_spec.rb +28 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/operator_matcher_spec.rb +223 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/raise_error_spec.rb +485 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/respond_to_spec.rb +292 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/satisfy_spec.rb +44 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/start_with_end_with_spec.rb +186 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/throw_symbol_spec.rb +116 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/rspec/matchers/yield_spec.rb +514 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/spec_helper.rb +54 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/support/classes.rb +56 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/support/in_sub_process.rb +38 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/support/matchers.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/support/ruby_version.rb +10 -0
- data/vendor/bundle/gems/rspec-expectations-2.14.2/spec/support/shared_examples.rb +13 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/.document +5 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/.yardopts +6 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/Changelog.md +410 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/License.txt +23 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/README.md +315 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/README.md +67 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/Scope.md +17 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/Upgrade.md +22 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/argument_matchers/README.md +27 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/argument_matchers/explicit.feature +59 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/argument_matchers/general_matchers.feature +85 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/argument_matchers/type_matchers.feature +26 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/README.md +73 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/allow_any_instance_of.feature +26 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/any_instance.feature +21 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/block_local_expectations.feature.pending +55 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/call_original.feature +24 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/expect_any_instance_of.feature +27 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/expect_message_using_expect.feature +107 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/expect_message_using_should_receive.feature +118 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/receive_counts.feature +209 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/message_expectations/warn_when_expectation_is_set_on_nil.feature +50 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/method_stubs/README.md +73 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/method_stubs/any_instance.feature +136 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/method_stubs/as_null_object.feature +40 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/method_stubs/simple_return_value_with_allow.feature +44 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/method_stubs/simple_return_value_with_stub.feature +64 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/method_stubs/stub_chain.feature +51 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/method_stubs/stub_implementation.feature +48 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/method_stubs/to_ary.feature +51 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/mutating_constants/README.md +82 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/mutating_constants/hiding_defined_constant.feature +64 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/mutating_constants/stub_defined_constant.feature +79 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/mutating_constants/stub_undefined_constant.feature +50 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/outside_rspec/configuration.feature +62 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/outside_rspec/standalone.feature +33 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/spies/spy_partial_mock_method.feature +34 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/spies/spy_pure_mock_method.feature +76 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/spies/spy_unstubbed_method.feature +18 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/step_definitions/additional_cli_steps.rb +11 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/support/env.rb +13 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/support/rubinius.rb +6 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/features/test_frameworks/test_unit.feature +43 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks.rb +92 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/any_instance/chain.rb +93 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/any_instance/expectation_chain.rb +42 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/any_instance/message_chains.rb +60 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/any_instance/recorder.rb +206 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/any_instance/stub_chain.rb +38 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/any_instance/stub_chain_chain.rb +23 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/argument_list_matcher.rb +97 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/argument_matchers.rb +238 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/configuration.rb +55 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/deprecation.rb +18 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/error_generator.rb +179 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/errors.rb +12 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/example_methods.rb +156 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/extensions/instance_exec.rb +34 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/extensions/marshal.rb +17 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/framework.rb +34 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/instance_method_stasher.rb +94 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/matchers/have_received.rb +93 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/matchers/receive.rb +96 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/message_expectation.rb +583 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/method_double.rb +265 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/mock.rb +7 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/mutate_const.rb +403 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/order_group.rb +40 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/proxy.rb +216 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/proxy_for_nil.rb +37 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/space.rb +87 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/standalone.rb +3 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/stub_chain.rb +51 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/syntax.rb +349 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/targets.rb +69 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/test_double.rb +135 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/rspec/mocks/version.rb +7 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/lib/spec/mocks.rb +4 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/and_call_original_spec.rb +243 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/and_yield_spec.rb +127 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/any_instance/message_chains_spec.rb +40 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/any_instance_spec.rb +963 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/any_number_of_times_spec.rb +36 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/argument_expectation_spec.rb +32 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/at_least_spec.rb +151 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/at_most_spec.rb +90 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/block_return_value_spec.rb +88 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/bug_report_10260_spec.rb +8 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/bug_report_10263_spec.rb +27 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/bug_report_11545_spec.rb +32 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/bug_report_496_spec.rb +17 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/bug_report_600_spec.rb +22 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/bug_report_7611_spec.rb +16 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/bug_report_8165_spec.rb +31 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/bug_report_830_spec.rb +21 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/bug_report_957_spec.rb +22 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/combining_implementation_instructions_spec.rb +205 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/configuration_spec.rb +150 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/double_spec.rb +24 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/extensions/marshal_spec.rb +54 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/failing_argument_matchers_spec.rb +110 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/hash_excluding_matcher_spec.rb +67 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/hash_including_matcher_spec.rb +90 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/instance_method_stasher_spec.rb +58 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/matchers/have_received_spec.rb +266 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/matchers/receive_spec.rb +328 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/methods_spec.rb +27 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/mock_ordering_spec.rb +103 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/mock_space_spec.rb +113 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/mock_spec.rb +798 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/multiple_return_value_spec.rb +132 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/mutate_const_spec.rb +501 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/nil_expectation_warning_spec.rb +68 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/null_object_mock_spec.rb +123 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/once_counts_spec.rb +52 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/options_hash_spec.rb +35 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/partial_mock_spec.rb +205 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb +95 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/passing_argument_matchers_spec.rb +142 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/precise_counts_spec.rb +68 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/record_messages_spec.rb +26 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/serialization_spec.rb +89 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/stash_spec.rb +46 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/stub_chain_spec.rb +154 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/stub_implementation_spec.rb +81 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/stub_spec.rb +353 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/stubbed_message_expectations_spec.rb +58 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/syntax_agnostic_message_matchers_spec.rb +81 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/test_double_spec.rb +67 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/to_ary_spec.rb +54 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/twice_counts_spec.rb +66 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks_spec.rb +65 -0
- data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/spec_helper.rb +60 -0
- data/vendor/bundle/specifications/diff-lcs-1.2.4.gemspec +64 -0
- data/vendor/bundle/specifications/rake-10.1.0.gemspec +35 -0
- data/vendor/bundle/specifications/rspec-2.14.1.gemspec +39 -0
- data/vendor/bundle/specifications/rspec-core-2.14.5.gemspec +58 -0
- data/vendor/bundle/specifications/rspec-expectations-2.14.2.gemspec +40 -0
- data/vendor/bundle/specifications/rspec-mocks-2.14.3.gemspec +37 -0
- metadata +657 -11
@@ -0,0 +1,127 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RSpec::Mocks::Mock do
|
4
|
+
|
5
|
+
let(:obj) { double }
|
6
|
+
|
7
|
+
describe "#and_yield" do
|
8
|
+
context 'when the method double has been constrained by `with`' do
|
9
|
+
it 'uses the default stub if the provided args do not match' do
|
10
|
+
obj.stub(:foo) { 15 }
|
11
|
+
obj.stub(:foo).with(:yield).and_yield
|
12
|
+
|
13
|
+
# should_receive is required to trigger the bug:
|
14
|
+
# https://github.com/rspec/rspec-mocks/issues/127
|
15
|
+
obj.should_receive(:foo)
|
16
|
+
|
17
|
+
expect(obj.foo(:dont_yield)).to eq(15)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context "with eval context as block argument" do
|
22
|
+
|
23
|
+
it "evaluates the supplied block as it is read" do
|
24
|
+
evaluated = false
|
25
|
+
obj.stub(:method_that_accepts_a_block).and_yield do |eval_context|
|
26
|
+
evaluated = true
|
27
|
+
end
|
28
|
+
expect(evaluated).to be_true
|
29
|
+
end
|
30
|
+
|
31
|
+
it "passes an eval context object to the supplied block" do
|
32
|
+
obj.stub(:method_that_accepts_a_block).and_yield do |eval_context|
|
33
|
+
expect(eval_context).not_to be_nil
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
it "evaluates the block passed to the stubbed method in the context of the supplied eval context" do
|
38
|
+
expected_eval_context = nil
|
39
|
+
actual_eval_context = nil
|
40
|
+
|
41
|
+
obj.stub(:method_that_accepts_a_block).and_yield do |eval_context|
|
42
|
+
expected_eval_context = eval_context
|
43
|
+
end
|
44
|
+
|
45
|
+
obj.method_that_accepts_a_block do
|
46
|
+
actual_eval_context = self
|
47
|
+
end
|
48
|
+
|
49
|
+
expect(actual_eval_context).to equal(expected_eval_context)
|
50
|
+
end
|
51
|
+
|
52
|
+
context "and no yielded arguments" do
|
53
|
+
|
54
|
+
it "passes when expectations set on the eval context are met" do
|
55
|
+
configured_eval_context = nil
|
56
|
+
obj.stub(:method_that_accepts_a_block).and_yield do |eval_context|
|
57
|
+
configured_eval_context = eval_context
|
58
|
+
configured_eval_context.should_receive(:foo)
|
59
|
+
end
|
60
|
+
|
61
|
+
obj.method_that_accepts_a_block do
|
62
|
+
foo
|
63
|
+
end
|
64
|
+
|
65
|
+
verify configured_eval_context
|
66
|
+
end
|
67
|
+
|
68
|
+
it "fails when expectations set on the eval context are not met" do
|
69
|
+
configured_eval_context = nil
|
70
|
+
obj.stub(:method_that_accepts_a_block).and_yield do |eval_context|
|
71
|
+
configured_eval_context = eval_context
|
72
|
+
configured_eval_context.should_receive(:foo)
|
73
|
+
end
|
74
|
+
|
75
|
+
obj.method_that_accepts_a_block do
|
76
|
+
# foo is not called here
|
77
|
+
end
|
78
|
+
|
79
|
+
expect { verify configured_eval_context }.to raise_error(RSpec::Mocks::MockExpectationError)
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
context "and yielded arguments" do
|
85
|
+
|
86
|
+
it "passes when expectations set on the eval context and yielded arguments are met" do
|
87
|
+
configured_eval_context = nil
|
88
|
+
yielded_arg = Object.new
|
89
|
+
obj.stub(:method_that_accepts_a_block).and_yield(yielded_arg) do |eval_context|
|
90
|
+
configured_eval_context = eval_context
|
91
|
+
configured_eval_context.should_receive(:foo)
|
92
|
+
yielded_arg.should_receive(:bar)
|
93
|
+
end
|
94
|
+
|
95
|
+
obj.method_that_accepts_a_block do |obj|
|
96
|
+
obj.bar
|
97
|
+
foo
|
98
|
+
end
|
99
|
+
|
100
|
+
verify configured_eval_context
|
101
|
+
verify yielded_arg
|
102
|
+
end
|
103
|
+
|
104
|
+
it "fails when expectations set on the eval context and yielded arguments are not met" do
|
105
|
+
configured_eval_context = nil
|
106
|
+
yielded_arg = Object.new
|
107
|
+
obj.stub(:method_that_accepts_a_block).and_yield(yielded_arg) do |eval_context|
|
108
|
+
configured_eval_context = eval_context
|
109
|
+
configured_eval_context.should_receive(:foo)
|
110
|
+
yielded_arg.should_receive(:bar)
|
111
|
+
end
|
112
|
+
|
113
|
+
obj.method_that_accepts_a_block do |obj|
|
114
|
+
# obj.bar is not called here
|
115
|
+
# foo is not called here
|
116
|
+
end
|
117
|
+
|
118
|
+
expect { verify configured_eval_context }.to raise_error(RSpec::Mocks::MockExpectationError)
|
119
|
+
expect { verify yielded_arg }.to raise_error(RSpec::Mocks::MockExpectationError)
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
data/vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/any_instance/message_chains_spec.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RSpec::Mocks::AnyInstance::MessageChains do
|
4
|
+
let(:chains) { RSpec::Mocks::AnyInstance::MessageChains.new }
|
5
|
+
let(:stub_chain) { RSpec::Mocks::AnyInstance::StubChain.new }
|
6
|
+
let(:expectation_chain) { RSpec::Mocks::AnyInstance::PositiveExpectationChain.new }
|
7
|
+
|
8
|
+
it "knows if a method does not have an expectation set on it" do
|
9
|
+
chains.add(:method_name, stub_chain)
|
10
|
+
expect(chains.has_expectation?(:method_name)).to be_false
|
11
|
+
end
|
12
|
+
|
13
|
+
it "knows if a method has an expectation set on it" do
|
14
|
+
chains.add(:method_name, stub_chain)
|
15
|
+
chains.add(:method_name, expectation_chain)
|
16
|
+
expect(chains.has_expectation?(:method_name)).to be_true
|
17
|
+
end
|
18
|
+
|
19
|
+
it "can remove all stub chains" do
|
20
|
+
chains.add(:method_name, stub_chain)
|
21
|
+
chains.add(:method_name, expectation_chain)
|
22
|
+
chains.add(:method_name, RSpec::Mocks::AnyInstance::StubChain.new)
|
23
|
+
|
24
|
+
chains.remove_stub_chains_for!(:method_name)
|
25
|
+
expect(chains[:method_name]).to eq([expectation_chain])
|
26
|
+
end
|
27
|
+
|
28
|
+
context "creating stub chains" do
|
29
|
+
it "understands how to add a stub chain for a method" do
|
30
|
+
chains.add(:method_name, stub_chain)
|
31
|
+
expect(chains[:method_name]).to eq([stub_chain])
|
32
|
+
end
|
33
|
+
|
34
|
+
it "allows multiple stub chains for a method" do
|
35
|
+
chains.add(:method_name, stub_chain)
|
36
|
+
chains.add(:method_name, another_stub_chain = RSpec::Mocks::AnyInstance::StubChain.new)
|
37
|
+
expect(chains[:method_name]).to eq([stub_chain, another_stub_chain])
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,963 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'delegate'
|
3
|
+
|
4
|
+
module RSpec
|
5
|
+
module Mocks
|
6
|
+
describe "#any_instance" do
|
7
|
+
class CustomErrorForAnyInstanceSpec < StandardError;end
|
8
|
+
|
9
|
+
let(:klass) do
|
10
|
+
Class.new do
|
11
|
+
def existing_method; :existing_method_return_value; end
|
12
|
+
def existing_method_with_arguments(arg_one, arg_two = nil); :existing_method_with_arguments_return_value; end
|
13
|
+
def another_existing_method; end
|
14
|
+
private
|
15
|
+
def private_method; :private_method_return_value; end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
let(:existing_method_return_value){ :existing_method_return_value }
|
19
|
+
|
20
|
+
context "invocation order" do
|
21
|
+
context "#stub" do
|
22
|
+
it "raises an error if 'stub' follows 'with'" do
|
23
|
+
expect { klass.any_instance.with("1").stub(:foo) }.to raise_error(NoMethodError)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "raises an error if 'with' follows 'and_return'" do
|
27
|
+
expect { klass.any_instance.stub(:foo).and_return(1).with("1") }.to raise_error(NoMethodError)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "raises an error if 'with' follows 'and_raise'" do
|
31
|
+
expect { klass.any_instance.stub(:foo).and_raise(1).with("1") }.to raise_error(NoMethodError)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "raises an error if 'with' follows 'and_yield'" do
|
35
|
+
expect { klass.any_instance.stub(:foo).and_yield(1).with("1") }.to raise_error(NoMethodError)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context "#stub_chain" do
|
40
|
+
it "raises an error if 'stub_chain' follows 'any_instance'" do
|
41
|
+
expect { klass.any_instance.and_return("1").stub_chain(:foo, :bar) }.to raise_error(NoMethodError)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
context "#should_receive" do
|
46
|
+
it "raises an error if 'should_receive' follows 'with'" do
|
47
|
+
expect { klass.any_instance.with("1").should_receive(:foo) }.to raise_error(NoMethodError)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "raises an error if 'with' follows 'and_return'" do
|
51
|
+
pending "see Github issue #42"
|
52
|
+
expect { klass.any_instance.should_receive(:foo).and_return(1).with("1") }.to raise_error(NoMethodError)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "raises an error if 'with' follows 'and_raise'" do
|
56
|
+
pending "see Github issue #42"
|
57
|
+
expect { klass.any_instance.should_receive(:foo).and_raise(1).with("1") }.to raise_error(NoMethodError)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
context "with #stub" do
|
63
|
+
it "does not suppress an exception when a method that doesn't exist is invoked" do
|
64
|
+
klass.any_instance.stub(:foo)
|
65
|
+
expect { klass.new.bar }.to raise_error(NoMethodError)
|
66
|
+
end
|
67
|
+
|
68
|
+
context 'multiple methods' do
|
69
|
+
it "allows multiple methods to be stubbed in a single invocation" do
|
70
|
+
klass.any_instance.stub(:foo => 'foo', :bar => 'bar')
|
71
|
+
instance = klass.new
|
72
|
+
expect(instance.foo).to eq('foo')
|
73
|
+
expect(instance.bar).to eq('bar')
|
74
|
+
end
|
75
|
+
|
76
|
+
it "adheres to the contract of multiple method stubbing withou any instance" do
|
77
|
+
expect(Object.new.stub(:foo => 'foo', :bar => 'bar')).to eq(:foo => 'foo', :bar => 'bar')
|
78
|
+
expect(klass.any_instance.stub(:foo => 'foo', :bar => 'bar')).to eq(:foo => 'foo', :bar => 'bar')
|
79
|
+
end
|
80
|
+
|
81
|
+
context "allows a chain of methods to be stubbed using #stub_chain" do
|
82
|
+
it "given symbols representing the methods" do
|
83
|
+
klass.any_instance.stub_chain(:one, :two, :three).and_return(:four)
|
84
|
+
expect(klass.new.one.two.three).to eq(:four)
|
85
|
+
end
|
86
|
+
|
87
|
+
it "given a hash as the last argument uses the value as the expected return value" do
|
88
|
+
klass.any_instance.stub_chain(:one, :two, :three => :four)
|
89
|
+
expect(klass.new.one.two.three).to eq(:four)
|
90
|
+
end
|
91
|
+
|
92
|
+
it "given a string of '.' separated method names representing the chain" do
|
93
|
+
klass.any_instance.stub_chain('one.two.three').and_return(:four)
|
94
|
+
expect(klass.new.one.two.three).to eq(:four)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
context "behaves as 'every instance'" do
|
100
|
+
it "stubs every instance in the spec" do
|
101
|
+
klass.any_instance.stub(:foo).and_return(result = Object.new)
|
102
|
+
expect(klass.new.foo).to eq(result)
|
103
|
+
expect(klass.new.foo).to eq(result)
|
104
|
+
end
|
105
|
+
|
106
|
+
it "stubs instance created before any_instance was called" do
|
107
|
+
instance = klass.new
|
108
|
+
klass.any_instance.stub(:foo).and_return(result = Object.new)
|
109
|
+
expect(instance.foo).to eq(result)
|
110
|
+
end
|
111
|
+
|
112
|
+
it 'handles freeze and duplication correctly' do
|
113
|
+
String.any_instance.stub(:any_method)
|
114
|
+
|
115
|
+
foo = 'foo'.freeze
|
116
|
+
expect(foo.dup.concat 'bar').to eq 'foobar'
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
context "with argument matching" do
|
121
|
+
before do
|
122
|
+
klass.any_instance.stub(:foo).with(:param_one, :param_two).and_return(:result_one)
|
123
|
+
klass.any_instance.stub(:foo).with(:param_three, :param_four).and_return(:result_two)
|
124
|
+
end
|
125
|
+
|
126
|
+
it "returns the stubbed value when arguments match" do
|
127
|
+
instance = klass.new
|
128
|
+
expect(instance.foo(:param_one, :param_two)).to eq(:result_one)
|
129
|
+
expect(instance.foo(:param_three, :param_four)).to eq(:result_two)
|
130
|
+
end
|
131
|
+
|
132
|
+
it "fails the spec with an expectation error when the arguments do not match" do
|
133
|
+
expect do
|
134
|
+
klass.new.foo(:param_one, :param_three)
|
135
|
+
end.to(raise_error(RSpec::Mocks::MockExpectationError))
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
context "with multiple stubs" do
|
140
|
+
before do
|
141
|
+
klass.any_instance.stub(:foo).and_return(1)
|
142
|
+
klass.any_instance.stub(:bar).and_return(2)
|
143
|
+
end
|
144
|
+
|
145
|
+
it "stubs a method" do
|
146
|
+
instance = klass.new
|
147
|
+
expect(instance.foo).to eq(1)
|
148
|
+
expect(instance.bar).to eq(2)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "returns the same value for calls on different instances" do
|
152
|
+
expect(klass.new.foo).to eq(klass.new.foo)
|
153
|
+
expect(klass.new.bar).to eq(klass.new.bar)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
context "with #and_return" do
|
158
|
+
it "stubs a method that doesn't exist" do
|
159
|
+
klass.any_instance.stub(:foo).and_return(1)
|
160
|
+
expect(klass.new.foo).to eq(1)
|
161
|
+
end
|
162
|
+
|
163
|
+
it "stubs a method that exists" do
|
164
|
+
klass.any_instance.stub(:existing_method).and_return(1)
|
165
|
+
expect(klass.new.existing_method).to eq(1)
|
166
|
+
end
|
167
|
+
|
168
|
+
it "returns the same object for calls on different instances" do
|
169
|
+
return_value = Object.new
|
170
|
+
klass.any_instance.stub(:foo).and_return(return_value)
|
171
|
+
expect(klass.new.foo).to be(return_value)
|
172
|
+
expect(klass.new.foo).to be(return_value)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
context "with #and_yield" do
|
177
|
+
it "yields the value specified" do
|
178
|
+
yielded_value = Object.new
|
179
|
+
klass.any_instance.stub(:foo).and_yield(yielded_value)
|
180
|
+
klass.new.foo{|value| expect(value).to be(yielded_value)}
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
context 'with #and_call_original and competing #with' do
|
185
|
+
let(:klass) { Struct.new(:a_method) }
|
186
|
+
|
187
|
+
it 'can combine and_call_original, with, and_return' do
|
188
|
+
allow_any_instance_of(klass).to receive(:a_method).and_call_original
|
189
|
+
allow_any_instance_of(klass).to receive(:a_method).with(:arg).and_return('value')
|
190
|
+
|
191
|
+
expect(klass.new('org').a_method).to eq 'org'
|
192
|
+
expect(klass.new.a_method(:arg)).to eq 'value'
|
193
|
+
end
|
194
|
+
|
195
|
+
it 'can combine and_call_original, with, and_return (old syntax)' do
|
196
|
+
klass.any_instance.stub(:a_method).and_call_original
|
197
|
+
klass.any_instance.stub(:a_method).with(:arg).and_return('value')
|
198
|
+
|
199
|
+
expect(klass.new('org').a_method).to eq 'org'
|
200
|
+
expect(klass.new.a_method(:arg)).to eq 'value'
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
context "with #and_raise" do
|
205
|
+
it "stubs a method that doesn't exist" do
|
206
|
+
klass.any_instance.stub(:foo).and_raise(CustomErrorForAnyInstanceSpec)
|
207
|
+
expect { klass.new.foo}.to raise_error(CustomErrorForAnyInstanceSpec)
|
208
|
+
end
|
209
|
+
|
210
|
+
it "stubs a method that exists" do
|
211
|
+
klass.any_instance.stub(:existing_method).and_raise(CustomErrorForAnyInstanceSpec)
|
212
|
+
expect { klass.new.existing_method}.to raise_error(CustomErrorForAnyInstanceSpec)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
context "with a block" do
|
217
|
+
it "stubs a method" do
|
218
|
+
klass.any_instance.stub(:foo) { 1 }
|
219
|
+
expect(klass.new.foo).to eq(1)
|
220
|
+
end
|
221
|
+
|
222
|
+
it "returns the same computed value for calls on different instances" do
|
223
|
+
klass.any_instance.stub(:foo) { 1 + 2 }
|
224
|
+
expect(klass.new.foo).to eq(klass.new.foo)
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
context "core ruby objects" do
|
229
|
+
it "works uniformly across *everything*" do
|
230
|
+
Object.any_instance.stub(:foo).and_return(1)
|
231
|
+
expect(Object.new.foo).to eq(1)
|
232
|
+
end
|
233
|
+
|
234
|
+
it "works with the non-standard constructor []" do
|
235
|
+
Array.any_instance.stub(:foo).and_return(1)
|
236
|
+
expect([].foo).to eq(1)
|
237
|
+
end
|
238
|
+
|
239
|
+
it "works with the non-standard constructor {}" do
|
240
|
+
Hash.any_instance.stub(:foo).and_return(1)
|
241
|
+
expect({}.foo).to eq(1)
|
242
|
+
end
|
243
|
+
|
244
|
+
it "works with the non-standard constructor \"\"" do
|
245
|
+
String.any_instance.stub(:foo).and_return(1)
|
246
|
+
expect("".foo).to eq(1)
|
247
|
+
end
|
248
|
+
|
249
|
+
it "works with the non-standard constructor \'\'" do
|
250
|
+
String.any_instance.stub(:foo).and_return(1)
|
251
|
+
expect(''.foo).to eq(1)
|
252
|
+
end
|
253
|
+
|
254
|
+
it "works with the non-standard constructor module" do
|
255
|
+
Module.any_instance.stub(:foo).and_return(1)
|
256
|
+
module RSpec::SampleRspecTestModule;end
|
257
|
+
expect(RSpec::SampleRspecTestModule.foo).to eq(1)
|
258
|
+
end
|
259
|
+
|
260
|
+
it "works with the non-standard constructor class" do
|
261
|
+
Class.any_instance.stub(:foo).and_return(1)
|
262
|
+
class RSpec::SampleRspecTestClass;end
|
263
|
+
expect(RSpec::SampleRspecTestClass.foo).to eq(1)
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
context "with #stub!" do
|
269
|
+
it "raises with a message instructing the user to use stub instead" do
|
270
|
+
expect do
|
271
|
+
klass.any_instance.stub!(:foo)
|
272
|
+
end.to raise_error(/Use stub instead/)
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
context "with #unstub!" do
|
277
|
+
it "raises with a message instructing the user to use unstub instead" do
|
278
|
+
expect do
|
279
|
+
klass.any_instance.unstub!(:foo)
|
280
|
+
end.to raise_error(/Use unstub instead/)
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
context "unstub implementation" do
|
285
|
+
it "replaces the stubbed method with the original method" do
|
286
|
+
klass.any_instance.stub(:existing_method)
|
287
|
+
klass.any_instance.unstub(:existing_method)
|
288
|
+
expect(klass.new.existing_method).to eq(:existing_method_return_value)
|
289
|
+
end
|
290
|
+
|
291
|
+
it "removes all stubs with the supplied method name" do
|
292
|
+
klass.any_instance.stub(:existing_method).with(1)
|
293
|
+
klass.any_instance.stub(:existing_method).with(2)
|
294
|
+
klass.any_instance.unstub(:existing_method)
|
295
|
+
expect(klass.new.existing_method).to eq(:existing_method_return_value)
|
296
|
+
end
|
297
|
+
|
298
|
+
it "does not remove any expectations with the same method name" do
|
299
|
+
klass.any_instance.should_receive(:existing_method_with_arguments).with(3).and_return(:three)
|
300
|
+
klass.any_instance.stub(:existing_method_with_arguments).with(1)
|
301
|
+
klass.any_instance.stub(:existing_method_with_arguments).with(2)
|
302
|
+
klass.any_instance.unstub(:existing_method_with_arguments)
|
303
|
+
expect(klass.new.existing_method_with_arguments(3)).to eq(:three)
|
304
|
+
end
|
305
|
+
|
306
|
+
it "raises a MockExpectationError if the method has not been stubbed" do
|
307
|
+
expect {
|
308
|
+
klass.any_instance.unstub(:existing_method)
|
309
|
+
}.to raise_error(RSpec::Mocks::MockExpectationError, 'The method `existing_method` was not stubbed or was already unstubbed')
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
context "with #should_not_receive" do
|
314
|
+
it "fails if the method is called" do
|
315
|
+
klass.any_instance.should_not_receive(:existing_method)
|
316
|
+
expect { klass.new.existing_method }.to raise_error(RSpec::Mocks::MockExpectationError)
|
317
|
+
end
|
318
|
+
|
319
|
+
it "passes if no method is called" do
|
320
|
+
expect { klass.any_instance.should_not_receive(:existing_method) }.to_not raise_error
|
321
|
+
end
|
322
|
+
|
323
|
+
it "passes if only a different method is called" do
|
324
|
+
klass.any_instance.should_not_receive(:existing_method)
|
325
|
+
expect { klass.new.another_existing_method }.to_not raise_error
|
326
|
+
end
|
327
|
+
|
328
|
+
context "with constraints" do
|
329
|
+
it "fails if the method is called with the specified parameters" do
|
330
|
+
klass.any_instance.should_not_receive(:existing_method_with_arguments).with(:argument_one, :argument_two)
|
331
|
+
expect {
|
332
|
+
klass.new.existing_method_with_arguments(:argument_one, :argument_two)
|
333
|
+
}.to raise_error(RSpec::Mocks::MockExpectationError)
|
334
|
+
end
|
335
|
+
|
336
|
+
it "passes if the method is called with different parameters" do
|
337
|
+
klass.any_instance.should_not_receive(:existing_method_with_arguments).with(:argument_one, :argument_two)
|
338
|
+
expect { klass.new.existing_method_with_arguments(:argument_three, :argument_four) }.to_not raise_error
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
context 'when used in combination with should_receive' do
|
343
|
+
it 'passes if only the expected message is received' do
|
344
|
+
klass.any_instance.should_receive(:foo)
|
345
|
+
klass.any_instance.should_not_receive(:bar)
|
346
|
+
klass.new.foo
|
347
|
+
RSpec::Mocks.space.verify_all
|
348
|
+
end
|
349
|
+
end
|
350
|
+
|
351
|
+
it "prevents confusing double-negative expressions involving `never`" do
|
352
|
+
expect {
|
353
|
+
klass.any_instance.should_not_receive(:not_expected).never
|
354
|
+
}.to raise_error(/trying to negate it again/)
|
355
|
+
end
|
356
|
+
end
|
357
|
+
|
358
|
+
context "with #should_receive" do
|
359
|
+
let(:foo_expectation_error_message) { 'Exactly one instance should have received the following message(s) but didn\'t: foo' }
|
360
|
+
let(:existing_method_expectation_error_message) { 'Exactly one instance should have received the following message(s) but didn\'t: existing_method' }
|
361
|
+
|
362
|
+
context "with an expectation is set on a method which does not exist" do
|
363
|
+
it "returns the expected value" do
|
364
|
+
klass.any_instance.should_receive(:foo).and_return(1)
|
365
|
+
expect(klass.new.foo(1)).to eq(1)
|
366
|
+
end
|
367
|
+
|
368
|
+
it "fails if an instance is created but no invocation occurs" do
|
369
|
+
expect do
|
370
|
+
klass.any_instance.should_receive(:foo)
|
371
|
+
klass.new
|
372
|
+
RSpec::Mocks.space.verify_all
|
373
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, foo_expectation_error_message)
|
374
|
+
end
|
375
|
+
|
376
|
+
it "fails if no instance is created" do
|
377
|
+
expect do
|
378
|
+
klass.any_instance.should_receive(:foo).and_return(1)
|
379
|
+
RSpec::Mocks.space.verify_all
|
380
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, foo_expectation_error_message)
|
381
|
+
end
|
382
|
+
|
383
|
+
it "fails if no instance is created and there are multiple expectations" do
|
384
|
+
expect do
|
385
|
+
klass.any_instance.should_receive(:foo)
|
386
|
+
klass.any_instance.should_receive(:bar)
|
387
|
+
RSpec::Mocks.space.verify_all
|
388
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, 'Exactly one instance should have received the following message(s) but didn\'t: bar, foo')
|
389
|
+
end
|
390
|
+
|
391
|
+
it "allows expectations on instances to take priority" do
|
392
|
+
klass.any_instance.should_receive(:foo)
|
393
|
+
klass.new.foo
|
394
|
+
|
395
|
+
instance = klass.new
|
396
|
+
instance.should_receive(:foo).and_return(result = Object.new)
|
397
|
+
expect(instance.foo).to eq(result)
|
398
|
+
end
|
399
|
+
|
400
|
+
context "behaves as 'exactly one instance'" do
|
401
|
+
it "passes if subsequent invocations do not receive that message" do
|
402
|
+
klass.any_instance.should_receive(:foo)
|
403
|
+
klass.new.foo
|
404
|
+
klass.new
|
405
|
+
end
|
406
|
+
|
407
|
+
it "fails if the method is invoked on a second instance" do
|
408
|
+
instance_one = klass.new
|
409
|
+
instance_two = klass.new
|
410
|
+
expect do
|
411
|
+
klass.any_instance.should_receive(:foo)
|
412
|
+
|
413
|
+
instance_one.foo
|
414
|
+
instance_two.foo
|
415
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, "The message 'foo' was received by #{instance_two.inspect} but has already been received by #{instance_one.inspect}")
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
419
|
+
context "normal expectations on the class object" do
|
420
|
+
it "fail when unfulfilled" do
|
421
|
+
expect do
|
422
|
+
klass.any_instance.should_receive(:foo)
|
423
|
+
klass.should_receive(:woot)
|
424
|
+
klass.new.foo
|
425
|
+
RSpec::Mocks.space.verify_all
|
426
|
+
end.to(raise_error(RSpec::Mocks::MockExpectationError) do |error|
|
427
|
+
expect(error.message).not_to eq(existing_method_expectation_error_message)
|
428
|
+
end)
|
429
|
+
end
|
430
|
+
|
431
|
+
|
432
|
+
it "pass when expectations are met" do
|
433
|
+
klass.any_instance.should_receive(:foo)
|
434
|
+
klass.should_receive(:woot).and_return(result = Object.new)
|
435
|
+
klass.new.foo
|
436
|
+
expect(klass.woot).to eq(result)
|
437
|
+
end
|
438
|
+
end
|
439
|
+
end
|
440
|
+
|
441
|
+
context "with an expectation is set on a method that exists" do
|
442
|
+
it "returns the expected value" do
|
443
|
+
klass.any_instance.should_receive(:existing_method).and_return(1)
|
444
|
+
expect(klass.new.existing_method(1)).to eq(1)
|
445
|
+
end
|
446
|
+
|
447
|
+
it "fails if an instance is created but no invocation occurs" do
|
448
|
+
expect do
|
449
|
+
klass.any_instance.should_receive(:existing_method)
|
450
|
+
klass.new
|
451
|
+
RSpec::Mocks.space.verify_all
|
452
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, existing_method_expectation_error_message)
|
453
|
+
end
|
454
|
+
|
455
|
+
it "fails if no instance is created" do
|
456
|
+
expect do
|
457
|
+
klass.any_instance.should_receive(:existing_method)
|
458
|
+
RSpec::Mocks.space.verify_all
|
459
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, existing_method_expectation_error_message)
|
460
|
+
end
|
461
|
+
|
462
|
+
it "fails if no instance is created and there are multiple expectations" do
|
463
|
+
expect do
|
464
|
+
klass.any_instance.should_receive(:existing_method)
|
465
|
+
klass.any_instance.should_receive(:another_existing_method)
|
466
|
+
RSpec::Mocks.space.verify_all
|
467
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, 'Exactly one instance should have received the following message(s) but didn\'t: another_existing_method, existing_method')
|
468
|
+
end
|
469
|
+
|
470
|
+
context "after any one instance has received a message" do
|
471
|
+
it "passes if subsequent invocations do not receive that message" do
|
472
|
+
klass.any_instance.should_receive(:existing_method)
|
473
|
+
klass.new.existing_method
|
474
|
+
klass.new
|
475
|
+
end
|
476
|
+
|
477
|
+
it "fails if the method is invoked on a second instance" do
|
478
|
+
instance_one = klass.new
|
479
|
+
instance_two = klass.new
|
480
|
+
expect do
|
481
|
+
klass.any_instance.should_receive(:existing_method)
|
482
|
+
|
483
|
+
instance_one.existing_method
|
484
|
+
instance_two.existing_method
|
485
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, "The message 'existing_method' was received by #{instance_two.inspect} but has already been received by #{instance_one.inspect}")
|
486
|
+
end
|
487
|
+
end
|
488
|
+
end
|
489
|
+
|
490
|
+
it 'works with a BasicObject subclass that mixes in Kernel', :if => defined?(BasicObject) do
|
491
|
+
klass = Class.new(BasicObject) do
|
492
|
+
include ::Kernel
|
493
|
+
def foo; end
|
494
|
+
end
|
495
|
+
|
496
|
+
klass.any_instance.should_receive(:foo)
|
497
|
+
klass.new.foo
|
498
|
+
end
|
499
|
+
|
500
|
+
it 'works with a SimpleDelegator subclass', :if => (RUBY_VERSION.to_f > 1.8) do
|
501
|
+
klass = Class.new(SimpleDelegator) do
|
502
|
+
def foo; end
|
503
|
+
end
|
504
|
+
|
505
|
+
klass.any_instance.should_receive(:foo)
|
506
|
+
klass.new(Object.new).foo
|
507
|
+
end
|
508
|
+
|
509
|
+
context "with argument matching" do
|
510
|
+
before do
|
511
|
+
klass.any_instance.should_receive(:foo).with(:param_one, :param_two).and_return(:result_one)
|
512
|
+
klass.any_instance.should_receive(:foo).with(:param_three, :param_four).and_return(:result_two)
|
513
|
+
end
|
514
|
+
|
515
|
+
it "returns the expected value when arguments match" do
|
516
|
+
instance = klass.new
|
517
|
+
expect(instance.foo(:param_one, :param_two)).to eq(:result_one)
|
518
|
+
expect(instance.foo(:param_three, :param_four)).to eq(:result_two)
|
519
|
+
end
|
520
|
+
|
521
|
+
it "fails when the arguments match but different instances are used" do
|
522
|
+
instances = Array.new(2) { klass.new }
|
523
|
+
expect do
|
524
|
+
expect(instances[0].foo(:param_one, :param_two)).to eq(:result_one)
|
525
|
+
expect(instances[1].foo(:param_three, :param_four)).to eq(:result_two)
|
526
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError)
|
527
|
+
|
528
|
+
# ignore the fact that should_receive expectations were not met
|
529
|
+
instances.each { |instance| reset instance }
|
530
|
+
end
|
531
|
+
|
532
|
+
it "is not affected by the invocation of existing methods on other instances" do
|
533
|
+
expect(klass.new.existing_method_with_arguments(:param_one, :param_two)).to eq(:existing_method_with_arguments_return_value)
|
534
|
+
instance = klass.new
|
535
|
+
expect(instance.foo(:param_one, :param_two)).to eq(:result_one)
|
536
|
+
expect(instance.foo(:param_three, :param_four)).to eq(:result_two)
|
537
|
+
end
|
538
|
+
|
539
|
+
it "fails when arguments do not match" do
|
540
|
+
instance = klass.new
|
541
|
+
expect do
|
542
|
+
instance.foo(:param_one, :param_three)
|
543
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError)
|
544
|
+
|
545
|
+
# ignore the fact that should_receive expectations were not met
|
546
|
+
reset instance
|
547
|
+
end
|
548
|
+
end
|
549
|
+
|
550
|
+
context "message count" do
|
551
|
+
context "the 'once' constraint" do
|
552
|
+
it "passes for one invocation" do
|
553
|
+
klass.any_instance.should_receive(:foo).once
|
554
|
+
klass.new.foo
|
555
|
+
end
|
556
|
+
|
557
|
+
it "fails when no instances are declared" do
|
558
|
+
expect do
|
559
|
+
klass.any_instance.should_receive(:foo).once
|
560
|
+
RSpec::Mocks.space.verify_all
|
561
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, foo_expectation_error_message)
|
562
|
+
end
|
563
|
+
|
564
|
+
it "fails when an instance is declared but there are no invocations" do
|
565
|
+
expect do
|
566
|
+
klass.any_instance.should_receive(:foo).once
|
567
|
+
klass.new
|
568
|
+
RSpec::Mocks.space.verify_all
|
569
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, foo_expectation_error_message)
|
570
|
+
end
|
571
|
+
|
572
|
+
it "fails for more than one invocation" do
|
573
|
+
expect do
|
574
|
+
klass.any_instance.should_receive(:foo).once
|
575
|
+
instance = klass.new
|
576
|
+
2.times { instance.foo }
|
577
|
+
verify instance
|
578
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError)
|
579
|
+
end
|
580
|
+
end
|
581
|
+
|
582
|
+
context "the 'twice' constraint" do
|
583
|
+
it "passes for two invocations" do
|
584
|
+
klass.any_instance.should_receive(:foo).twice
|
585
|
+
instance = klass.new
|
586
|
+
2.times { instance.foo }
|
587
|
+
end
|
588
|
+
|
589
|
+
it "fails for more than two invocations" do
|
590
|
+
expect do
|
591
|
+
klass.any_instance.should_receive(:foo).twice
|
592
|
+
instance = klass.new
|
593
|
+
3.times { instance.foo }
|
594
|
+
verify instance
|
595
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError)
|
596
|
+
end
|
597
|
+
end
|
598
|
+
|
599
|
+
context "the 'exactly(n)' constraint" do
|
600
|
+
it "passes for n invocations where n = 3" do
|
601
|
+
klass.any_instance.should_receive(:foo).exactly(3).times
|
602
|
+
instance = klass.new
|
603
|
+
3.times { instance.foo }
|
604
|
+
end
|
605
|
+
|
606
|
+
it "fails for n invocations where n < 3" do
|
607
|
+
expect do
|
608
|
+
klass.any_instance.should_receive(:foo).exactly(3).times
|
609
|
+
instance = klass.new
|
610
|
+
2.times { instance.foo }
|
611
|
+
verify instance
|
612
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError)
|
613
|
+
end
|
614
|
+
|
615
|
+
it "fails for n invocations where n > 3" do
|
616
|
+
expect do
|
617
|
+
klass.any_instance.should_receive(:foo).exactly(3).times
|
618
|
+
instance = klass.new
|
619
|
+
4.times { instance.foo }
|
620
|
+
verify instance
|
621
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError)
|
622
|
+
end
|
623
|
+
end
|
624
|
+
|
625
|
+
context "the 'at_least(n)' constraint" do
|
626
|
+
it "passes for n invocations where n = 3" do
|
627
|
+
klass.any_instance.should_receive(:foo).at_least(3).times
|
628
|
+
instance = klass.new
|
629
|
+
3.times { instance.foo }
|
630
|
+
end
|
631
|
+
|
632
|
+
it "fails for n invocations where n < 3" do
|
633
|
+
expect do
|
634
|
+
klass.any_instance.should_receive(:foo).at_least(3).times
|
635
|
+
instance = klass.new
|
636
|
+
2.times { instance.foo }
|
637
|
+
verify instance
|
638
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError)
|
639
|
+
end
|
640
|
+
|
641
|
+
it "passes for n invocations where n > 3" do
|
642
|
+
klass.any_instance.should_receive(:foo).at_least(3).times
|
643
|
+
instance = klass.new
|
644
|
+
4.times { instance.foo }
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
context "the 'at_most(n)' constraint" do
|
649
|
+
it "passes for n invocations where n = 3" do
|
650
|
+
klass.any_instance.should_receive(:foo).at_most(3).times
|
651
|
+
instance = klass.new
|
652
|
+
3.times { instance.foo }
|
653
|
+
end
|
654
|
+
|
655
|
+
it "passes for n invocations where n < 3" do
|
656
|
+
klass.any_instance.should_receive(:foo).at_most(3).times
|
657
|
+
instance = klass.new
|
658
|
+
2.times { instance.foo }
|
659
|
+
end
|
660
|
+
|
661
|
+
it "fails for n invocations where n > 3" do
|
662
|
+
expect do
|
663
|
+
klass.any_instance.should_receive(:foo).at_most(3).times
|
664
|
+
instance = klass.new
|
665
|
+
4.times { instance.foo }
|
666
|
+
verify instance
|
667
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError)
|
668
|
+
end
|
669
|
+
end
|
670
|
+
|
671
|
+
context "the 'never' constraint" do
|
672
|
+
it "passes for 0 invocations" do
|
673
|
+
klass.any_instance.should_receive(:foo).never
|
674
|
+
RSpec::Mocks.space.verify_all
|
675
|
+
end
|
676
|
+
|
677
|
+
it "fails on the first invocation" do
|
678
|
+
expect do
|
679
|
+
klass.any_instance.should_receive(:foo).never
|
680
|
+
klass.new.foo
|
681
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError)
|
682
|
+
end
|
683
|
+
|
684
|
+
context "when combined with other expectations" do
|
685
|
+
it "passes when the other expecations are met" do
|
686
|
+
klass.any_instance.should_receive(:foo).never
|
687
|
+
klass.any_instance.should_receive(:existing_method).and_return(5)
|
688
|
+
expect(klass.new.existing_method).to eq(5)
|
689
|
+
end
|
690
|
+
|
691
|
+
it "fails when the other expecations are not met" do
|
692
|
+
expect do
|
693
|
+
klass.any_instance.should_receive(:foo).never
|
694
|
+
klass.any_instance.should_receive(:existing_method).and_return(5)
|
695
|
+
RSpec::Mocks.space.verify_all
|
696
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, existing_method_expectation_error_message)
|
697
|
+
end
|
698
|
+
end
|
699
|
+
end
|
700
|
+
|
701
|
+
context "the 'any_number_of_times' constraint" do
|
702
|
+
it "passes for 0 invocations" do
|
703
|
+
klass.any_instance.should_receive(:foo).any_number_of_times
|
704
|
+
verify klass.new
|
705
|
+
end
|
706
|
+
|
707
|
+
it "passes for a non-zero number of invocations" do
|
708
|
+
allow(RSpec).to receive(:deprecate).with("any_number_of_times", :replacement => "stub")
|
709
|
+
|
710
|
+
klass.any_instance.should_receive(:foo).any_number_of_times
|
711
|
+
instance = klass.new
|
712
|
+
instance.foo
|
713
|
+
verify instance
|
714
|
+
end
|
715
|
+
|
716
|
+
it "does not interfere with other expectations" do
|
717
|
+
klass.any_instance.should_receive(:foo).any_number_of_times
|
718
|
+
klass.any_instance.should_receive(:existing_method).and_return(5)
|
719
|
+
expect(klass.new.existing_method).to eq(5)
|
720
|
+
end
|
721
|
+
|
722
|
+
context "when combined with other expectations" do
|
723
|
+
it "passes when the other expecations are met" do
|
724
|
+
klass.any_instance.should_receive(:foo).any_number_of_times
|
725
|
+
klass.any_instance.should_receive(:existing_method).and_return(5)
|
726
|
+
expect(klass.new.existing_method).to eq(5)
|
727
|
+
end
|
728
|
+
|
729
|
+
it "fails when the other expecations are not met" do
|
730
|
+
expect do
|
731
|
+
klass.any_instance.should_receive(:foo).any_number_of_times
|
732
|
+
klass.any_instance.should_receive(:existing_method).and_return(5)
|
733
|
+
RSpec::Mocks.space.verify_all
|
734
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, existing_method_expectation_error_message)
|
735
|
+
end
|
736
|
+
end
|
737
|
+
end
|
738
|
+
end
|
739
|
+
end
|
740
|
+
|
741
|
+
context "when resetting post-verification" do
|
742
|
+
let(:space) { RSpec::Mocks.space }
|
743
|
+
|
744
|
+
context "existing method" do
|
745
|
+
before(:each) do
|
746
|
+
klass.any_instance # to force it to be tracked
|
747
|
+
end
|
748
|
+
|
749
|
+
context "with stubbing" do
|
750
|
+
context "public methods" do
|
751
|
+
before(:each) do
|
752
|
+
klass.any_instance.stub(:existing_method).and_return(1)
|
753
|
+
expect(klass.method_defined?(:__existing_method_without_any_instance__)).to be_true
|
754
|
+
end
|
755
|
+
|
756
|
+
it "restores the class to its original state after each example when no instance is created" do
|
757
|
+
space.verify_all
|
758
|
+
|
759
|
+
expect(klass.method_defined?(:__existing_method_without_any_instance__)).to be_false
|
760
|
+
expect(klass.new.existing_method).to eq(existing_method_return_value)
|
761
|
+
end
|
762
|
+
|
763
|
+
it "restores the class to its original state after each example when one instance is created" do
|
764
|
+
klass.new.existing_method
|
765
|
+
|
766
|
+
space.verify_all
|
767
|
+
|
768
|
+
expect(klass.method_defined?(:__existing_method_without_any_instance__)).to be_false
|
769
|
+
expect(klass.new.existing_method).to eq(existing_method_return_value)
|
770
|
+
end
|
771
|
+
|
772
|
+
it "restores the class to its original state after each example when more than one instance is created" do
|
773
|
+
klass.new.existing_method
|
774
|
+
klass.new.existing_method
|
775
|
+
|
776
|
+
space.verify_all
|
777
|
+
|
778
|
+
expect(klass.method_defined?(:__existing_method_without_any_instance__)).to be_false
|
779
|
+
expect(klass.new.existing_method).to eq(existing_method_return_value)
|
780
|
+
end
|
781
|
+
end
|
782
|
+
|
783
|
+
context "private methods" do
|
784
|
+
before :each do
|
785
|
+
klass.any_instance.stub(:private_method).and_return(:something)
|
786
|
+
space.verify_all
|
787
|
+
end
|
788
|
+
|
789
|
+
it "cleans up the backed up method" do
|
790
|
+
expect(klass.method_defined?(:__existing_method_without_any_instance__)).to be_false
|
791
|
+
end
|
792
|
+
|
793
|
+
it "restores a stubbed private method after the spec is run" do
|
794
|
+
expect(klass.private_method_defined?(:private_method)).to be_true
|
795
|
+
end
|
796
|
+
|
797
|
+
it "ensures that the restored method behaves as it originally did" do
|
798
|
+
expect(klass.new.send(:private_method)).to eq(:private_method_return_value)
|
799
|
+
end
|
800
|
+
end
|
801
|
+
end
|
802
|
+
|
803
|
+
context "with expectations" do
|
804
|
+
context "private methods" do
|
805
|
+
before :each do
|
806
|
+
klass.any_instance.should_receive(:private_method).and_return(:something)
|
807
|
+
klass.new.private_method
|
808
|
+
space.verify_all
|
809
|
+
end
|
810
|
+
|
811
|
+
it "cleans up the backed up method" do
|
812
|
+
expect(klass.method_defined?(:__existing_method_without_any_instance__)).to be_false
|
813
|
+
end
|
814
|
+
|
815
|
+
it "restores a stubbed private method after the spec is run" do
|
816
|
+
expect(klass.private_method_defined?(:private_method)).to be_true
|
817
|
+
end
|
818
|
+
|
819
|
+
it "ensures that the restored method behaves as it originally did" do
|
820
|
+
expect(klass.new.send(:private_method)).to eq(:private_method_return_value)
|
821
|
+
end
|
822
|
+
end
|
823
|
+
|
824
|
+
context "ensures that the subsequent specs do not see expectations set in previous specs" do
|
825
|
+
context "when the instance created after the expectation is set" do
|
826
|
+
it "first spec" do
|
827
|
+
klass.any_instance.should_receive(:existing_method).and_return(Object.new)
|
828
|
+
klass.new.existing_method
|
829
|
+
end
|
830
|
+
|
831
|
+
it "second spec" do
|
832
|
+
expect(klass.new.existing_method).to eq(existing_method_return_value)
|
833
|
+
end
|
834
|
+
end
|
835
|
+
|
836
|
+
context "when the instance created before the expectation is set" do
|
837
|
+
before :each do
|
838
|
+
@instance = klass.new
|
839
|
+
end
|
840
|
+
|
841
|
+
it "first spec" do
|
842
|
+
klass.any_instance.should_receive(:existing_method).and_return(Object.new)
|
843
|
+
@instance.existing_method
|
844
|
+
end
|
845
|
+
|
846
|
+
it "second spec" do
|
847
|
+
expect(@instance.existing_method).to eq(existing_method_return_value)
|
848
|
+
end
|
849
|
+
end
|
850
|
+
end
|
851
|
+
|
852
|
+
it "ensures that the next spec does not see that expectation" do
|
853
|
+
klass.any_instance.should_receive(:existing_method).and_return(Object.new)
|
854
|
+
klass.new.existing_method
|
855
|
+
space.verify_all
|
856
|
+
|
857
|
+
expect(klass.new.existing_method).to eq(existing_method_return_value)
|
858
|
+
end
|
859
|
+
end
|
860
|
+
end
|
861
|
+
|
862
|
+
context "with multiple calls to any_instance in the same example" do
|
863
|
+
it "does not prevent the change from being rolled back" do
|
864
|
+
klass.any_instance.stub(:existing_method).and_return(false)
|
865
|
+
klass.any_instance.stub(:existing_method).and_return(true)
|
866
|
+
|
867
|
+
RSpec::Mocks.space.verify_all
|
868
|
+
expect(klass.new).to respond_to(:existing_method)
|
869
|
+
expect(klass.new.existing_method).to eq(existing_method_return_value)
|
870
|
+
end
|
871
|
+
end
|
872
|
+
|
873
|
+
it "adds an class to the current space when #any_instance is invoked" do
|
874
|
+
expect {
|
875
|
+
klass.any_instance
|
876
|
+
}.to change { space.any_instance_recorders.size }.by(1)
|
877
|
+
end
|
878
|
+
|
879
|
+
it "adds an instance to the current space when stubbed method is invoked" do
|
880
|
+
klass.any_instance.stub(:foo)
|
881
|
+
instance = klass.new
|
882
|
+
instance.foo
|
883
|
+
expect(RSpec::Mocks.space.proxies.keys).to include(instance.object_id)
|
884
|
+
end
|
885
|
+
end
|
886
|
+
|
887
|
+
context 'when used in conjunction with a `dup`' do
|
888
|
+
it "doesn't cause an infinite loop" do
|
889
|
+
pending "This intermittently fails on JRuby" if RUBY_PLATFORM == 'java'
|
890
|
+
|
891
|
+
Object.any_instance.stub(:some_method)
|
892
|
+
o = Object.new
|
893
|
+
o.some_method
|
894
|
+
expect { o.dup.some_method }.to_not raise_error
|
895
|
+
end
|
896
|
+
|
897
|
+
it "doesn't bomb if the object doesn't support `dup`" do
|
898
|
+
klass = Class.new do
|
899
|
+
undef_method :dup
|
900
|
+
end
|
901
|
+
klass.any_instance
|
902
|
+
end
|
903
|
+
|
904
|
+
it "doesn't fail when dup accepts parameters" do
|
905
|
+
klass = Class.new do
|
906
|
+
def dup(funky_option)
|
907
|
+
end
|
908
|
+
end
|
909
|
+
|
910
|
+
klass.any_instance
|
911
|
+
|
912
|
+
expect { klass.new.dup('Dup dup dup') }.to_not raise_error
|
913
|
+
end
|
914
|
+
end
|
915
|
+
|
916
|
+
context "when directed at a method defined on a superclass" do
|
917
|
+
let(:sub_klass) { Class.new(klass) }
|
918
|
+
|
919
|
+
it "stubs the method correctly" do
|
920
|
+
klass.any_instance.stub(:existing_method).and_return("foo")
|
921
|
+
expect(sub_klass.new.existing_method).to eq "foo"
|
922
|
+
end
|
923
|
+
|
924
|
+
it "mocks the method correctly" do
|
925
|
+
instance_one = sub_klass.new
|
926
|
+
instance_two = sub_klass.new
|
927
|
+
expect do
|
928
|
+
klass.any_instance.should_receive(:existing_method)
|
929
|
+
instance_one.existing_method
|
930
|
+
instance_two.existing_method
|
931
|
+
end.to raise_error(RSpec::Mocks::MockExpectationError, "The message 'existing_method' was received by #{instance_two.inspect} but has already been received by #{instance_one.inspect}")
|
932
|
+
end
|
933
|
+
end
|
934
|
+
|
935
|
+
context "when a class overrides Object#method" do
|
936
|
+
let(:http_request_class) { Struct.new(:method, :uri) }
|
937
|
+
|
938
|
+
it "stubs the method correctly" do
|
939
|
+
http_request_class.any_instance.stub(:existing_method).and_return("foo")
|
940
|
+
expect(http_request_class.new.existing_method).to eq "foo"
|
941
|
+
end
|
942
|
+
|
943
|
+
it "mocks the method correctly" do
|
944
|
+
http_request_class.any_instance.should_receive(:existing_method).and_return("foo")
|
945
|
+
expect(http_request_class.new.existing_method).to eq "foo"
|
946
|
+
end
|
947
|
+
end
|
948
|
+
|
949
|
+
context "when used after the test has finished" do
|
950
|
+
it "restores the original behavior of a stubbed method" do
|
951
|
+
klass.any_instance.stub(:existing_method).and_return(:stubbed_return_value)
|
952
|
+
|
953
|
+
instance = klass.new
|
954
|
+
expect(instance.existing_method).to eq :stubbed_return_value
|
955
|
+
|
956
|
+
RSpec::Mocks.verify
|
957
|
+
|
958
|
+
expect(instance.existing_method).to eq :existing_method_return_value
|
959
|
+
end
|
960
|
+
end
|
961
|
+
end
|
962
|
+
end
|
963
|
+
end
|