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
File without changes
|
@@ -0,0 +1,417 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ostruct'
|
3
|
+
require 'rspec/core/drb_options'
|
4
|
+
|
5
|
+
describe RSpec::Core::ConfigurationOptions, :isolated_directory => true, :isolated_home => true do
|
6
|
+
include ConfigOptionsHelper
|
7
|
+
|
8
|
+
it "warns when HOME env var is not set", :unless => (RUBY_PLATFORM == 'java') do
|
9
|
+
without_env_vars 'HOME' do
|
10
|
+
coo = RSpec::Core::ConfigurationOptions.new([])
|
11
|
+
coo.should_receive(:warn)
|
12
|
+
coo.parse_options
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
it "duplicates the arguments array" do
|
17
|
+
args = ['-e', 'some spec']
|
18
|
+
coo = RSpec::Core::ConfigurationOptions.new(args)
|
19
|
+
coo.parse_options
|
20
|
+
expect(args).to eq(['-e', 'some spec'])
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "#configure" do
|
24
|
+
it "sends libs before requires" do
|
25
|
+
opts = config_options_object(*%w[--require a/path -I a/lib])
|
26
|
+
config = double("config").as_null_object
|
27
|
+
config.should_receive(:libs=).ordered
|
28
|
+
config.should_receive(:setup_load_path_and_require).ordered
|
29
|
+
opts.configure(config)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "sends loads requires before loading specs" do
|
33
|
+
opts = config_options_object(*%w[-rspec_helper])
|
34
|
+
config = double("config").as_null_object
|
35
|
+
expect(config).to receive(:setup_load_path_and_require).ordered
|
36
|
+
expect(config).to receive(:files_or_directories_to_run=).ordered
|
37
|
+
opts.configure(config)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "sets up load path and requires before formatter" do
|
41
|
+
opts = config_options_object(*%w[--require a/path -f a/formatter])
|
42
|
+
config = double("config").as_null_object
|
43
|
+
config.should_receive(:setup_load_path_and_require).ordered
|
44
|
+
config.should_receive(:add_formatter).ordered
|
45
|
+
opts.configure(config)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "sends default_path before files_or_directories_to_run" do
|
49
|
+
opts = config_options_object(*%w[--default_path spec])
|
50
|
+
config = double("config").as_null_object
|
51
|
+
config.should_receive(:force).with(:default_path => 'spec').ordered
|
52
|
+
config.should_receive(:files_or_directories_to_run=).ordered
|
53
|
+
opts.configure(config)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "sends pattern before files_or_directories_to_run" do
|
57
|
+
opts = config_options_object(*%w[--pattern **/*.spec])
|
58
|
+
config = double("config").as_null_object
|
59
|
+
config.should_receive(:force).with(:pattern => '**/*.spec').ordered
|
60
|
+
config.should_receive(:files_or_directories_to_run=).ordered
|
61
|
+
opts.configure(config)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "assigns inclusion_filter" do
|
65
|
+
opts = config_options_object(*%w[--tag awesome])
|
66
|
+
config = RSpec::Core::Configuration.new
|
67
|
+
opts.configure(config)
|
68
|
+
expect(config.inclusion_filter).to have_key(:awesome)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "merges the :exclusion_filter option with the default exclusion_filter" do
|
72
|
+
opts = config_options_object(*%w[--tag ~slow])
|
73
|
+
config = RSpec::Core::Configuration.new
|
74
|
+
opts.configure(config)
|
75
|
+
expect(config.exclusion_filter).to have_key(:slow)
|
76
|
+
end
|
77
|
+
|
78
|
+
it "forces color_enabled" do
|
79
|
+
opts = config_options_object(*%w[--color])
|
80
|
+
config = RSpec::Core::Configuration.new
|
81
|
+
config.should_receive(:force).with(:color => true)
|
82
|
+
opts.configure(config)
|
83
|
+
end
|
84
|
+
|
85
|
+
[
|
86
|
+
["--failure-exit-code", "3", :failure_exit_code, 3 ],
|
87
|
+
["--pattern", "foo/bar", :pattern, "foo/bar"],
|
88
|
+
["--failure-exit-code", "37", :failure_exit_code, 37],
|
89
|
+
["--default_path", "behavior", :default_path, "behavior"],
|
90
|
+
["--order", "rand", :order, "rand"],
|
91
|
+
["--seed", "37", :order, "rand:37"],
|
92
|
+
["--drb-port", "37", :drb_port, 37]
|
93
|
+
].each do |cli_option, cli_value, config_key, config_value|
|
94
|
+
it "forces #{config_key}" do
|
95
|
+
opts = config_options_object(*[cli_option, cli_value].compact)
|
96
|
+
config = RSpec::Core::Configuration.new
|
97
|
+
config.should_receive(:force) do |pair|
|
98
|
+
expect(pair.keys.first).to eq(config_key)
|
99
|
+
expect(pair.values.first).to eq(config_value)
|
100
|
+
end
|
101
|
+
opts.configure(config)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
it "sets debug directly" do
|
106
|
+
opts = config_options_object("--debug")
|
107
|
+
config = RSpec::Core::Configuration.new
|
108
|
+
config.should_receive(:debug=).with(true)
|
109
|
+
opts.configure(config)
|
110
|
+
end
|
111
|
+
|
112
|
+
it "merges --require specified by multiple configuration sources" do
|
113
|
+
with_env_vars 'SPEC_OPTS' => "--require file_from_env" do
|
114
|
+
opts = config_options_object(*%w[--require file_from_opts])
|
115
|
+
config = RSpec::Core::Configuration.new
|
116
|
+
config.should_receive(:require).with("file_from_opts")
|
117
|
+
config.should_receive(:require).with("file_from_env")
|
118
|
+
opts.configure(config)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
it "merges --I specified by multiple configuration sources" do
|
123
|
+
with_env_vars 'SPEC_OPTS' => "-I dir_from_env" do
|
124
|
+
opts = config_options_object(*%w[-I dir_from_opts])
|
125
|
+
config = RSpec::Core::Configuration.new
|
126
|
+
config.should_receive(:libs=).with(["dir_from_opts", "dir_from_env"])
|
127
|
+
opts.configure(config)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
describe "-c, --color, and --colour" do
|
133
|
+
it "sets :color => true" do
|
134
|
+
expect(parse_options('-c')).to include(:color => true)
|
135
|
+
expect(parse_options('--color')).to include(:color => true)
|
136
|
+
expect(parse_options('--colour')).to include(:color => true)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
describe "--no-color" do
|
141
|
+
it "sets :color => false" do
|
142
|
+
expect(parse_options('--no-color')).to include(:color => false)
|
143
|
+
end
|
144
|
+
|
145
|
+
it "overrides previous :color => true" do
|
146
|
+
expect(parse_options('--color', '--no-color')).to include(:color => false)
|
147
|
+
end
|
148
|
+
|
149
|
+
it "gets overriden by a subsequent :color => true" do
|
150
|
+
expect(parse_options('--no-color', '--color')).to include(:color => true)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
describe "-I" do
|
155
|
+
example "adds to :libs" do
|
156
|
+
expect(parse_options('-I', 'a_dir')).to include(:libs => ['a_dir'])
|
157
|
+
end
|
158
|
+
example "can be used more than once" do
|
159
|
+
expect(parse_options('-I', 'dir_1', '-I', 'dir_2')).to include(:libs => ['dir_1','dir_2'])
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
describe '--require' do
|
164
|
+
example "requires files" do
|
165
|
+
expect(parse_options('--require', 'a/path')).to include(:requires => ['a/path'])
|
166
|
+
end
|
167
|
+
example "can be used more than once" do
|
168
|
+
expect(parse_options('--require', 'path/1', '--require', 'path/2')).to include(:requires => ['path/1','path/2'])
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
describe "--format, -f" do
|
173
|
+
it "sets :formatter" do
|
174
|
+
[['--format', 'd'], ['-f', 'd'], '-fd'].each do |args|
|
175
|
+
expect(parse_options(*args)).to include(:formatters => [['d']])
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
example "can accept a class name" do
|
180
|
+
expect(parse_options('-fSome::Formatter::Class')).to include(:formatters => [['Some::Formatter::Class']])
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
describe "--profile, -p" do
|
185
|
+
it "sets :profile_examples" do
|
186
|
+
expect(parse_options('-p')).to include(:profile_examples => true)
|
187
|
+
expect(parse_options('--profile')).to include(:profile_examples => true)
|
188
|
+
expect(parse_options('-p', '4')).to include(:profile_examples => 4)
|
189
|
+
expect(parse_options('--profile', '3')).to include(:profile_examples => 3)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
describe "--no-profile" do
|
194
|
+
it "sets :profile_examples to false" do
|
195
|
+
expect(parse_options('--no-profile')).to include(:profile_examples => false)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
describe '--line_number' do
|
200
|
+
it "sets :line_number" do
|
201
|
+
expect(parse_options('-l','3')).to include(:line_numbers => ['3'])
|
202
|
+
expect(parse_options('--line_number','3')).to include(:line_numbers => ['3'])
|
203
|
+
end
|
204
|
+
|
205
|
+
it "can be specified multiple times" do
|
206
|
+
expect(parse_options('-l','3', '-l', '6')).to include(:line_numbers => ['3', '6'])
|
207
|
+
expect(parse_options('--line_number','3', '--line_number', '6')).to include(:line_numbers => ['3', '6'])
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
describe "--example" do
|
212
|
+
it "sets :full_description" do
|
213
|
+
expect(parse_options('--example','foo')).to include(:full_description => [/foo/])
|
214
|
+
expect(parse_options('-e','bar')).to include(:full_description => [/bar/])
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
describe "--backtrace, -b" do
|
219
|
+
it "sets full_backtrace on config" do
|
220
|
+
expect(parse_options("--backtrace")).to include(:full_backtrace => true)
|
221
|
+
expect(parse_options("-b")).to include(:full_backtrace => true)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
describe "--debug, -d" do
|
226
|
+
it "sets :debug => true" do
|
227
|
+
expect(parse_options("--debug")).to include(:debug => true)
|
228
|
+
expect(parse_options("-d")).to include(:debug => true)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
describe "--fail-fast" do
|
233
|
+
it "defaults to false" do
|
234
|
+
expect(parse_options[:fail_fast]).to be_false
|
235
|
+
end
|
236
|
+
|
237
|
+
it "sets fail_fast on config" do
|
238
|
+
expect(parse_options("--fail-fast")[:fail_fast]).to be_true
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
describe "--failure-exit-code" do
|
243
|
+
it "sets :failure_exit_code" do
|
244
|
+
expect(parse_options('--failure-exit-code', '0')).to include(:failure_exit_code => 0)
|
245
|
+
expect(parse_options('--failure-exit-code', '1')).to include(:failure_exit_code => 1)
|
246
|
+
expect(parse_options('--failure-exit-code', '2')).to include(:failure_exit_code => 2)
|
247
|
+
end
|
248
|
+
|
249
|
+
it "overrides previous :failure_exit_code" do
|
250
|
+
expect(parse_options('--failure-exit-code', '2', '--failure-exit-code', '3')).to include(:failure_exit_code => 3)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
describe "--options" do
|
255
|
+
it "sets :custom_options_file" do
|
256
|
+
expect(parse_options(*%w[-O my.opts])).to include(:custom_options_file => "my.opts")
|
257
|
+
expect(parse_options(*%w[--options my.opts])).to include(:custom_options_file => "my.opts")
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
describe "--drb, -X" do
|
262
|
+
context "combined with --debug" do
|
263
|
+
it "turns off the debugger if --drb is specified first" do
|
264
|
+
expect(config_options_object("--drb", "--debug").drb_argv).not_to include("--debug")
|
265
|
+
expect(config_options_object("--drb", "-d" ).drb_argv).not_to include("--debug")
|
266
|
+
expect(config_options_object("-X", "--debug").drb_argv).not_to include("--debug")
|
267
|
+
expect(config_options_object("-X", "-d" ).drb_argv).not_to include("--debug")
|
268
|
+
end
|
269
|
+
|
270
|
+
it "turns off the debugger option if --drb is specified later" do
|
271
|
+
expect(config_options_object("--debug", "--drb").drb_argv).not_to include("--debug")
|
272
|
+
expect(config_options_object("-d", "--drb").drb_argv).not_to include("--debug")
|
273
|
+
expect(config_options_object("--debug", "-X" ).drb_argv).not_to include("--debug")
|
274
|
+
expect(config_options_object("-d", "-X" ).drb_argv).not_to include("--debug")
|
275
|
+
end
|
276
|
+
|
277
|
+
it "turns off the debugger option if --drb is specified in the options file" do
|
278
|
+
File.open("./.rspec", "w") {|f| f << "--drb"}
|
279
|
+
expect(config_options_object("--debug").drb_argv).not_to include("--debug")
|
280
|
+
expect(config_options_object("-d" ).drb_argv).not_to include("--debug")
|
281
|
+
end
|
282
|
+
|
283
|
+
it "turns off the debugger option if --debug is specified in the options file" do
|
284
|
+
File.open("./.rspec", "w") {|f| f << "--debug"}
|
285
|
+
expect(config_options_object("--drb").drb_argv).not_to include("--debug")
|
286
|
+
expect(config_options_object("-X" ).drb_argv).not_to include("--debug")
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
it "does not send --drb back to the parser after parsing options" do
|
291
|
+
expect(config_options_object("--drb", "--color").drb_argv).not_to include("--drb")
|
292
|
+
end
|
293
|
+
|
294
|
+
end
|
295
|
+
|
296
|
+
describe "--no-drb" do
|
297
|
+
it "disables drb" do
|
298
|
+
expect(parse_options("--no-drb")).to include(:drb => false)
|
299
|
+
end
|
300
|
+
|
301
|
+
it "overrides a previous drb => true" do
|
302
|
+
expect(parse_options("--drb", "--no-drb")).to include(:drb => false)
|
303
|
+
end
|
304
|
+
|
305
|
+
it "gets overriden by a subsquent drb => true" do
|
306
|
+
expect(parse_options("--no-drb", "--drb")).to include(:drb => true)
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
|
311
|
+
describe "files_or_directories_to_run" do
|
312
|
+
it "parses files from '-c file.rb dir/file.rb'" do
|
313
|
+
expect(parse_options("-c", "file.rb", "dir/file.rb")).to include(
|
314
|
+
:files_or_directories_to_run => ["file.rb", "dir/file.rb"]
|
315
|
+
)
|
316
|
+
end
|
317
|
+
|
318
|
+
it "parses dir from 'dir'" do
|
319
|
+
expect(parse_options("dir")).to include(:files_or_directories_to_run => ["dir"])
|
320
|
+
end
|
321
|
+
|
322
|
+
it "parses dir and files from 'spec/file1_spec.rb, spec/file2_spec.rb'" do
|
323
|
+
expect(parse_options("dir", "spec/file1_spec.rb", "spec/file2_spec.rb")).to include(
|
324
|
+
:files_or_directories_to_run => ["dir", "spec/file1_spec.rb", "spec/file2_spec.rb"]
|
325
|
+
)
|
326
|
+
end
|
327
|
+
|
328
|
+
it "provides no files or directories if spec directory does not exist" do
|
329
|
+
FileTest.stub(:directory?).with("spec").and_return false
|
330
|
+
expect(parse_options()).to include(:files_or_directories_to_run => [])
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
describe "default_path" do
|
335
|
+
it "gets set before files_or_directories_to_run" do
|
336
|
+
config = double("config").as_null_object
|
337
|
+
config.should_receive(:force).with(:default_path => 'foo').ordered
|
338
|
+
config.should_receive(:files_or_directories_to_run=).ordered
|
339
|
+
opts = config_options_object("--default_path", "foo")
|
340
|
+
opts.configure(config)
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
describe "#filter_manager" do
|
345
|
+
it "returns the same object as RSpec::configuration.filter_manager" do
|
346
|
+
expect(config_options_object.filter_manager).to be(RSpec::configuration.filter_manager)
|
347
|
+
end
|
348
|
+
end
|
349
|
+
|
350
|
+
describe "sources: ~/.rspec, ./.rspec, ./.rspec-local, custom, CLI, and SPEC_OPTS" do
|
351
|
+
it "merges global, local, SPEC_OPTS, and CLI" do
|
352
|
+
File.open("./.rspec", "w") {|f| f << "--line 37"}
|
353
|
+
File.open("./.rspec-local", "w") {|f| f << "--format global"}
|
354
|
+
File.open(File.expand_path("~/.rspec"), "w") {|f| f << "--color"}
|
355
|
+
with_env_vars 'SPEC_OPTS' => "--debug --example 'foo bar'" do
|
356
|
+
options = parse_options("--drb")
|
357
|
+
expect(options[:color]).to be_true
|
358
|
+
expect(options[:line_numbers]).to eq(["37"])
|
359
|
+
expect(options[:debug]).to be_true
|
360
|
+
expect(options[:full_description]).to eq([/foo\ bar/])
|
361
|
+
expect(options[:drb]).to be_true
|
362
|
+
expect(options[:formatters]).to eq([['global']])
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
366
|
+
it "prefers SPEC_OPTS over CLI" do
|
367
|
+
with_env_vars 'SPEC_OPTS' => "--format spec_opts" do
|
368
|
+
expect(parse_options("--format", "cli")[:formatters]).to eq([['spec_opts']])
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
it "prefers CLI over file options" do
|
373
|
+
File.open("./.rspec", "w") {|f| f << "--format project"}
|
374
|
+
File.open(File.expand_path("~/.rspec"), "w") {|f| f << "--format global"}
|
375
|
+
expect(parse_options("--format", "cli")[:formatters]).to eq([['cli']])
|
376
|
+
end
|
377
|
+
|
378
|
+
it "prefers project file options over global file options" do
|
379
|
+
File.open("./.rspec", "w") {|f| f << "--format project"}
|
380
|
+
File.open(File.expand_path("~/.rspec"), "w") {|f| f << "--format global"}
|
381
|
+
expect(parse_options[:formatters]).to eq([['project']])
|
382
|
+
end
|
383
|
+
|
384
|
+
it "prefers local file options over project file options" do
|
385
|
+
File.open("./.rspec-local", "w") {|f| f << "--format local"}
|
386
|
+
File.open("./.rspec", "w") {|f| f << "--format global"}
|
387
|
+
expect(parse_options[:formatters]).to eq([['local']])
|
388
|
+
end
|
389
|
+
|
390
|
+
it "parses options file correctly if erb code has trimming options" do
|
391
|
+
File.open("./.rspec", "w") do |f|
|
392
|
+
f << "<% if true -%>\n"
|
393
|
+
f << "--format local\n"
|
394
|
+
f << "<%- end %>\n"
|
395
|
+
end
|
396
|
+
|
397
|
+
expect(parse_options[:formatters]).to eq([['local']])
|
398
|
+
end
|
399
|
+
|
400
|
+
context "with custom options file" do
|
401
|
+
it "ignores project and global options files" do
|
402
|
+
File.open("./.rspec", "w") {|f| f << "--format project"}
|
403
|
+
File.open(File.expand_path("~/.rspec"), "w") {|f| f << "--format global"}
|
404
|
+
File.open("./custom.opts", "w") {|f| f << "--color"}
|
405
|
+
options = parse_options("-O", "./custom.opts")
|
406
|
+
expect(options[:format]).to be_nil
|
407
|
+
expect(options[:color]).to be_true
|
408
|
+
end
|
409
|
+
|
410
|
+
it "parses -e 'full spec description'" do
|
411
|
+
File.open("./custom.opts", "w") {|f| f << "-e 'The quick brown fox jumps over the lazy dog'"}
|
412
|
+
options = parse_options("-O", "./custom.opts")
|
413
|
+
expect(options[:full_description]).to eq([/The\ quick\ brown\ fox\ jumps\ over\ the\ lazy\ dog/])
|
414
|
+
end
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
@@ -0,0 +1,1561 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'tmpdir'
|
3
|
+
|
4
|
+
module RSpec::Core
|
5
|
+
|
6
|
+
describe Configuration do
|
7
|
+
|
8
|
+
let(:config) { Configuration.new }
|
9
|
+
|
10
|
+
describe "RSpec.configuration with a block" do
|
11
|
+
before { RSpec.stub(:warn_deprecation) }
|
12
|
+
|
13
|
+
it "is deprecated" do
|
14
|
+
RSpec.should_receive(:warn_deprecation)
|
15
|
+
RSpec.configuration {}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#deprecation_stream' do
|
20
|
+
it 'defaults to standard error' do
|
21
|
+
expect(config.deprecation_stream).to eq $stderr
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'is configurable' do
|
25
|
+
io = double 'deprecation io'
|
26
|
+
config.deprecation_stream = io
|
27
|
+
expect(config.deprecation_stream).to eq io
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "#setup_load_path_and_require" do
|
32
|
+
include_context "isolate load path mutation"
|
33
|
+
|
34
|
+
def absolute_path_to(dir)
|
35
|
+
File.expand_path("../../../../#{dir}", __FILE__)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'adds `lib` to the load path' do
|
39
|
+
lib_dir = absolute_path_to("lib")
|
40
|
+
$LOAD_PATH.delete(lib_dir)
|
41
|
+
|
42
|
+
expect($LOAD_PATH).not_to include(lib_dir)
|
43
|
+
config.setup_load_path_and_require []
|
44
|
+
expect($LOAD_PATH).to include(lib_dir)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'adds the configured `default_path` to the load path' do
|
48
|
+
config.default_path = 'features'
|
49
|
+
foo_dir = absolute_path_to("features")
|
50
|
+
|
51
|
+
expect($LOAD_PATH).not_to include(foo_dir)
|
52
|
+
config.setup_load_path_and_require []
|
53
|
+
expect($LOAD_PATH).to include(foo_dir)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'stores the required files' do
|
57
|
+
config.should_receive(:require).with('a/path')
|
58
|
+
config.setup_load_path_and_require ['a/path']
|
59
|
+
expect(config.requires).to eq ['a/path']
|
60
|
+
end
|
61
|
+
|
62
|
+
context "when `default_path` refers to a file rather than a directory" do
|
63
|
+
it 'does not add it to the load path' do
|
64
|
+
config.default_path = 'Rakefile'
|
65
|
+
config.setup_load_path_and_require []
|
66
|
+
expect($LOAD_PATH).not_to include(match(/Rakefile/))
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "#load_spec_files" do
|
72
|
+
it "loads files using load" do
|
73
|
+
config.files_to_run = ["foo.bar", "blah_spec.rb"]
|
74
|
+
config.should_receive(:load).twice
|
75
|
+
config.load_spec_files
|
76
|
+
end
|
77
|
+
|
78
|
+
it "loads each file once, even if duplicated in list" do
|
79
|
+
config.files_to_run = ["a_spec.rb", "a_spec.rb"]
|
80
|
+
config.should_receive(:load).once
|
81
|
+
config.load_spec_files
|
82
|
+
end
|
83
|
+
|
84
|
+
context "with rspec-1 loaded" do
|
85
|
+
before { stub_const("Spec::VERSION::MAJOR", 1) }
|
86
|
+
|
87
|
+
it "raises with a helpful message" do
|
88
|
+
expect {
|
89
|
+
config.load_spec_files
|
90
|
+
}.to raise_error(/rspec-1 has been loaded/)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe "#treat_symbols_as_metadata_keys_with_true_values?" do
|
96
|
+
it 'defaults to false' do
|
97
|
+
expect(config.treat_symbols_as_metadata_keys_with_true_values?).to be_false
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'can be set to true' do
|
101
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
102
|
+
expect(config.treat_symbols_as_metadata_keys_with_true_values?).to be_true
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe "#mock_framework" do
|
107
|
+
it "defaults to :rspec" do
|
108
|
+
config.should_receive(:require).with('rspec/core/mocking/with_rspec')
|
109
|
+
config.mock_framework
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
describe "#mock_framework="do
|
114
|
+
it "delegates to mock_with" do
|
115
|
+
config.should_receive(:mock_with).with(:rspec)
|
116
|
+
config.mock_framework = :rspec
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
shared_examples "a configurable framework adapter" do |m|
|
121
|
+
it "yields a config object if the framework_module supports it" do
|
122
|
+
custom_config = Struct.new(:custom_setting).new
|
123
|
+
mod = Module.new
|
124
|
+
mod.stub(:configuration => custom_config)
|
125
|
+
|
126
|
+
config.send m, mod do |mod_config|
|
127
|
+
mod_config.custom_setting = true
|
128
|
+
end
|
129
|
+
|
130
|
+
expect(custom_config.custom_setting).to be_true
|
131
|
+
end
|
132
|
+
|
133
|
+
it "raises if framework module doesn't support configuration" do
|
134
|
+
mod = Module.new
|
135
|
+
|
136
|
+
expect {
|
137
|
+
config.send m, mod do |mod_config|
|
138
|
+
end
|
139
|
+
}.to raise_error(/must respond to `configuration`/)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
describe "#mock_with" do
|
144
|
+
before { config.stub(:require) }
|
145
|
+
|
146
|
+
it_behaves_like "a configurable framework adapter", :mock_with
|
147
|
+
|
148
|
+
[:rspec, :mocha, :rr, :flexmock].each do |framework|
|
149
|
+
context "with #{framework}" do
|
150
|
+
it "requires the adapter for #{framework}" do
|
151
|
+
config.should_receive(:require).with("rspec/core/mocking/with_#{framework}")
|
152
|
+
config.mock_with framework
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
it "allows rspec-mocks to be configured with a provided block" do
|
158
|
+
mod = Module.new
|
159
|
+
|
160
|
+
RSpec::Mocks.configuration.should_receive(:add_stub_and_should_receive_to).with(mod)
|
161
|
+
|
162
|
+
config.mock_with :rspec do |c|
|
163
|
+
c.add_stub_and_should_receive_to mod
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
context "with a module" do
|
168
|
+
it "sets the mock_framework_adapter to that module" do
|
169
|
+
mod = Module.new
|
170
|
+
config.mock_with mod
|
171
|
+
expect(config.mock_framework).to eq(mod)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
it "uses the null adapter when set to any unknown key" do
|
176
|
+
config.should_receive(:require).with('rspec/core/mocking/with_absolutely_nothing')
|
177
|
+
config.mock_with :crazy_new_mocking_framework_ive_not_yet_heard_of
|
178
|
+
end
|
179
|
+
|
180
|
+
context 'when there are already some example groups defined' do
|
181
|
+
it 'raises an error since this setting must be applied before any groups are defined' do
|
182
|
+
RSpec.world.stub(:example_groups).and_return([double.as_null_object])
|
183
|
+
expect {
|
184
|
+
config.mock_with :mocha
|
185
|
+
}.to raise_error(/must be configured before any example groups are defined/)
|
186
|
+
end
|
187
|
+
|
188
|
+
it 'does not raise an error if the default `mock_with :rspec` is re-configured' do
|
189
|
+
config.mock_framework # called by RSpec when configuring the first example group
|
190
|
+
RSpec.world.stub(:example_groups).and_return([double.as_null_object])
|
191
|
+
config.mock_with :rspec
|
192
|
+
end
|
193
|
+
|
194
|
+
it 'does not raise an error if re-setting the same config' do
|
195
|
+
groups = []
|
196
|
+
RSpec.world.stub(:example_groups => groups)
|
197
|
+
config.mock_with :mocha
|
198
|
+
groups << double.as_null_object
|
199
|
+
config.mock_with :mocha
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
describe "#expectation_framework" do
|
205
|
+
it "defaults to :rspec" do
|
206
|
+
config.should_receive(:require).with('rspec/expectations')
|
207
|
+
config.expectation_frameworks
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
describe "#expectation_framework=" do
|
212
|
+
it "delegates to expect_with=" do
|
213
|
+
config.should_receive(:expect_with).with(:rspec)
|
214
|
+
config.expectation_framework = :rspec
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
describe "#expect_with" do
|
219
|
+
before do
|
220
|
+
stub_const("Test::Unit::Assertions", Module.new)
|
221
|
+
config.stub(:require)
|
222
|
+
end
|
223
|
+
|
224
|
+
it_behaves_like "a configurable framework adapter", :expect_with
|
225
|
+
|
226
|
+
[
|
227
|
+
[:rspec, 'rspec/expectations'],
|
228
|
+
[:stdlib, 'test/unit/assertions']
|
229
|
+
].each do |framework, required_file|
|
230
|
+
context "with #{framework}" do
|
231
|
+
it "requires #{required_file}" do
|
232
|
+
config.should_receive(:require).with(required_file)
|
233
|
+
config.expect_with framework
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
it "supports multiple calls" do
|
239
|
+
config.expect_with :rspec
|
240
|
+
config.expect_with :stdlib
|
241
|
+
expect(config.expectation_frameworks).to eq [RSpec::Matchers, Test::Unit::Assertions]
|
242
|
+
end
|
243
|
+
|
244
|
+
it "raises if block given with multiple args" do
|
245
|
+
expect {
|
246
|
+
config.expect_with :rspec, :stdlib do |mod_config|
|
247
|
+
end
|
248
|
+
}.to raise_error(/expect_with only accepts/)
|
249
|
+
end
|
250
|
+
|
251
|
+
it "raises ArgumentError if framework is not supported" do
|
252
|
+
expect do
|
253
|
+
config.expect_with :not_supported
|
254
|
+
end.to raise_error(ArgumentError)
|
255
|
+
end
|
256
|
+
|
257
|
+
context 'when there are already some example groups defined' do
|
258
|
+
it 'raises an error since this setting must be applied before any groups are defined' do
|
259
|
+
RSpec.world.stub(:example_groups).and_return([double.as_null_object])
|
260
|
+
expect {
|
261
|
+
config.expect_with :rspec
|
262
|
+
}.to raise_error(/must be configured before any example groups are defined/)
|
263
|
+
end
|
264
|
+
|
265
|
+
it 'does not raise an error if the default `expect_with :rspec` is re-configured' do
|
266
|
+
config.expectation_frameworks # called by RSpec when configuring the first example group
|
267
|
+
RSpec.world.stub(:example_groups).and_return([double.as_null_object])
|
268
|
+
config.expect_with :rspec
|
269
|
+
end
|
270
|
+
|
271
|
+
it 'does not raise an error if re-setting the same config' do
|
272
|
+
groups = []
|
273
|
+
RSpec.world.stub(:example_groups => groups)
|
274
|
+
config.expect_with :stdlib
|
275
|
+
groups << double.as_null_object
|
276
|
+
config.expect_with :stdlib
|
277
|
+
end
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
describe "#expecting_with_rspec?" do
|
282
|
+
before do
|
283
|
+
stub_const("Test::Unit::Assertions", Module.new)
|
284
|
+
config.stub(:require)
|
285
|
+
end
|
286
|
+
|
287
|
+
it "returns false by default" do
|
288
|
+
expect(config).not_to be_expecting_with_rspec
|
289
|
+
end
|
290
|
+
|
291
|
+
it "returns true when `expect_with :rspec` has been configured" do
|
292
|
+
config.expect_with :rspec
|
293
|
+
expect(config).to be_expecting_with_rspec
|
294
|
+
end
|
295
|
+
|
296
|
+
it "returns true when `expect_with :rspec, :stdlib` has been configured" do
|
297
|
+
config.expect_with :rspec, :stdlib
|
298
|
+
expect(config).to be_expecting_with_rspec
|
299
|
+
end
|
300
|
+
|
301
|
+
it "returns true when `expect_with :stdlib, :rspec` has been configured" do
|
302
|
+
config.expect_with :stdlib, :rspec
|
303
|
+
expect(config).to be_expecting_with_rspec
|
304
|
+
end
|
305
|
+
|
306
|
+
it "returns false when `expect_with :stdlib` has been configured" do
|
307
|
+
config.expect_with :stdlib
|
308
|
+
expect(config).not_to be_expecting_with_rspec
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
describe "#files_to_run" do
|
313
|
+
it "loads files not following pattern if named explicitly" do
|
314
|
+
config.files_or_directories_to_run = "spec/rspec/core/resources/a_bar.rb"
|
315
|
+
expect(config.files_to_run).to eq([ "spec/rspec/core/resources/a_bar.rb"])
|
316
|
+
end
|
317
|
+
|
318
|
+
it "prevents repetition of dir when start of the pattern" do
|
319
|
+
config.pattern = "spec/**/a_spec.rb"
|
320
|
+
config.files_or_directories_to_run = "spec"
|
321
|
+
expect(config.files_to_run).to eq(["spec/rspec/core/resources/a_spec.rb"])
|
322
|
+
end
|
323
|
+
|
324
|
+
it "does not prevent repetition of dir when later of the pattern" do
|
325
|
+
config.pattern = "rspec/**/a_spec.rb"
|
326
|
+
config.files_or_directories_to_run = "spec"
|
327
|
+
expect(config.files_to_run).to eq(["spec/rspec/core/resources/a_spec.rb"])
|
328
|
+
end
|
329
|
+
|
330
|
+
context "with <path>:<line_number>" do
|
331
|
+
it "overrides inclusion filters set on config" do
|
332
|
+
config.filter_run_including :foo => :bar
|
333
|
+
config.files_or_directories_to_run = "path/to/file.rb:37"
|
334
|
+
expect(config.inclusion_filter.size).to eq(1)
|
335
|
+
expect(config.inclusion_filter[:locations].keys.first).to match(/path\/to\/file\.rb$/)
|
336
|
+
expect(config.inclusion_filter[:locations].values.first).to eq([37])
|
337
|
+
end
|
338
|
+
|
339
|
+
it "overrides inclusion filters set before config" do
|
340
|
+
config.force(:inclusion_filter => {:foo => :bar})
|
341
|
+
config.files_or_directories_to_run = "path/to/file.rb:37"
|
342
|
+
expect(config.inclusion_filter.size).to eq(1)
|
343
|
+
expect(config.inclusion_filter[:locations].keys.first).to match(/path\/to\/file\.rb$/)
|
344
|
+
expect(config.inclusion_filter[:locations].values.first).to eq([37])
|
345
|
+
end
|
346
|
+
|
347
|
+
it "clears exclusion filters set on config" do
|
348
|
+
config.exclusion_filter = { :foo => :bar }
|
349
|
+
config.files_or_directories_to_run = "path/to/file.rb:37"
|
350
|
+
expect(config.exclusion_filter).to be_empty,
|
351
|
+
"expected exclusion filter to be empty:\n#{config.exclusion_filter}"
|
352
|
+
end
|
353
|
+
|
354
|
+
it "clears exclusion filters set before config" do
|
355
|
+
config.force(:exclusion_filter => { :foo => :bar })
|
356
|
+
config.files_or_directories_to_run = "path/to/file.rb:37"
|
357
|
+
expect(config.exclusion_filter).to be_empty,
|
358
|
+
"expected exclusion filter to be empty:\n#{config.exclusion_filter}"
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
362
|
+
context "with default pattern" do
|
363
|
+
it "loads files named _spec.rb" do
|
364
|
+
config.files_or_directories_to_run = "spec/rspec/core/resources"
|
365
|
+
expect(config.files_to_run).to eq([ "spec/rspec/core/resources/a_spec.rb"])
|
366
|
+
end
|
367
|
+
|
368
|
+
it "loads files in Windows", :if => RSpec.windows_os? do
|
369
|
+
config.files_or_directories_to_run = "C:\\path\\to\\project\\spec\\sub\\foo_spec.rb"
|
370
|
+
expect(config.files_to_run).to eq([ "C:/path/to/project/spec/sub/foo_spec.rb"])
|
371
|
+
end
|
372
|
+
|
373
|
+
it "loads files in Windows when directory is specified", :if => RSpec.windows_os? do
|
374
|
+
config.files_or_directories_to_run = "spec\\rspec\\core\\resources"
|
375
|
+
expect(config.files_to_run).to eq([ "spec/rspec/core/resources/a_spec.rb"])
|
376
|
+
end
|
377
|
+
end
|
378
|
+
|
379
|
+
context "with default default_path" do
|
380
|
+
it "loads files in the default path when run by rspec" do
|
381
|
+
config.stub(:command) { 'rspec' }
|
382
|
+
config.files_or_directories_to_run = []
|
383
|
+
expect(config.files_to_run).not_to be_empty
|
384
|
+
end
|
385
|
+
|
386
|
+
it "loads files in the default path when run with DRB (e.g., spork)" do
|
387
|
+
config.stub(:command) { 'spork' }
|
388
|
+
RSpec::Core::Runner.stub(:running_in_drb?) { true }
|
389
|
+
config.files_or_directories_to_run = []
|
390
|
+
expect(config.files_to_run).not_to be_empty
|
391
|
+
end
|
392
|
+
|
393
|
+
it "does not load files in the default path when run by ruby" do
|
394
|
+
config.stub(:command) { 'ruby' }
|
395
|
+
config.files_or_directories_to_run = []
|
396
|
+
expect(config.files_to_run).to be_empty
|
397
|
+
end
|
398
|
+
end
|
399
|
+
|
400
|
+
def specify_consistent_ordering_of_files_to_run
|
401
|
+
File.stub(:directory?).with('a') { true }
|
402
|
+
|
403
|
+
orderings = [
|
404
|
+
%w[ a/1.rb a/2.rb a/3.rb ],
|
405
|
+
%w[ a/2.rb a/1.rb a/3.rb ],
|
406
|
+
%w[ a/3.rb a/2.rb a/1.rb ]
|
407
|
+
].map do |files|
|
408
|
+
Dir.should_receive(:[]).with(/^\{?a/) { files }
|
409
|
+
yield
|
410
|
+
config.files_to_run
|
411
|
+
end
|
412
|
+
|
413
|
+
expect(orderings.uniq.size).to eq(1)
|
414
|
+
end
|
415
|
+
|
416
|
+
context 'when the given directories match the pattern' do
|
417
|
+
it 'orders the files in a consistent ordering, regardless of the underlying OS ordering' do
|
418
|
+
specify_consistent_ordering_of_files_to_run do
|
419
|
+
config.pattern = 'a/*.rb'
|
420
|
+
config.files_or_directories_to_run = 'a'
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
context 'when the pattern is given relative to the given directories' do
|
426
|
+
it 'orders the files in a consistent ordering, regardless of the underlying OS ordering' do
|
427
|
+
specify_consistent_ordering_of_files_to_run do
|
428
|
+
config.pattern = '*.rb'
|
429
|
+
config.files_or_directories_to_run = 'a'
|
430
|
+
end
|
431
|
+
end
|
432
|
+
end
|
433
|
+
|
434
|
+
context 'when given multiple file paths' do
|
435
|
+
it 'orders the files in a consistent ordering, regardless of the given order' do
|
436
|
+
File.stub(:directory?) { false } # fake it into thinking these a full file paths
|
437
|
+
|
438
|
+
files = ['a/b/c_spec.rb', 'c/b/a_spec.rb']
|
439
|
+
config.files_or_directories_to_run = *files
|
440
|
+
ordering_1 = config.files_to_run
|
441
|
+
|
442
|
+
config.files_or_directories_to_run = *(files.reverse)
|
443
|
+
ordering_2 = config.files_to_run
|
444
|
+
|
445
|
+
expect(ordering_1).to eq(ordering_2)
|
446
|
+
end
|
447
|
+
end
|
448
|
+
end
|
449
|
+
|
450
|
+
%w[pattern= filename_pattern=].each do |setter|
|
451
|
+
describe "##{setter}" do
|
452
|
+
context "with single pattern" do
|
453
|
+
before { config.send(setter, "**/*_foo.rb") }
|
454
|
+
it "loads files following pattern" do
|
455
|
+
file = File.expand_path(File.dirname(__FILE__) + "/resources/a_foo.rb")
|
456
|
+
config.files_or_directories_to_run = file
|
457
|
+
expect(config.files_to_run).to include(file)
|
458
|
+
end
|
459
|
+
|
460
|
+
it "loads files in directories following pattern" do
|
461
|
+
dir = File.expand_path(File.dirname(__FILE__) + "/resources")
|
462
|
+
config.files_or_directories_to_run = dir
|
463
|
+
expect(config.files_to_run).to include("#{dir}/a_foo.rb")
|
464
|
+
end
|
465
|
+
|
466
|
+
it "does not load files in directories not following pattern" do
|
467
|
+
dir = File.expand_path(File.dirname(__FILE__) + "/resources")
|
468
|
+
config.files_or_directories_to_run = dir
|
469
|
+
expect(config.files_to_run).not_to include("#{dir}/a_bar.rb")
|
470
|
+
end
|
471
|
+
end
|
472
|
+
|
473
|
+
context "with multiple patterns" do
|
474
|
+
it "supports comma separated values" do
|
475
|
+
config.send(setter, "**/*_foo.rb,**/*_bar.rb")
|
476
|
+
dir = File.expand_path(File.dirname(__FILE__) + "/resources")
|
477
|
+
config.files_or_directories_to_run = dir
|
478
|
+
expect(config.files_to_run).to include("#{dir}/a_foo.rb")
|
479
|
+
expect(config.files_to_run).to include("#{dir}/a_bar.rb")
|
480
|
+
end
|
481
|
+
|
482
|
+
it "supports comma separated values with spaces" do
|
483
|
+
config.send(setter, "**/*_foo.rb, **/*_bar.rb")
|
484
|
+
dir = File.expand_path(File.dirname(__FILE__) + "/resources")
|
485
|
+
config.files_or_directories_to_run = dir
|
486
|
+
expect(config.files_to_run).to include("#{dir}/a_foo.rb")
|
487
|
+
expect(config.files_to_run).to include("#{dir}/a_bar.rb")
|
488
|
+
end
|
489
|
+
|
490
|
+
it "supports curly braces glob syntax" do
|
491
|
+
config.send(setter, "**/*_{foo,bar}.rb")
|
492
|
+
dir = File.expand_path(File.dirname(__FILE__) + "/resources")
|
493
|
+
config.files_or_directories_to_run = dir
|
494
|
+
expect(config.files_to_run).to include("#{dir}/a_foo.rb")
|
495
|
+
expect(config.files_to_run).to include("#{dir}/a_bar.rb")
|
496
|
+
end
|
497
|
+
end
|
498
|
+
end
|
499
|
+
end
|
500
|
+
|
501
|
+
describe "path with line number" do
|
502
|
+
it "assigns the line number as a location filter" do
|
503
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:37"
|
504
|
+
expect(config.filter).to eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37]}})
|
505
|
+
end
|
506
|
+
end
|
507
|
+
|
508
|
+
context "with full_description set" do
|
509
|
+
it "overrides filters" do
|
510
|
+
config.filter_run :focused => true
|
511
|
+
config.full_description = "foo"
|
512
|
+
expect(config.filter).not_to have_key(:focused)
|
513
|
+
end
|
514
|
+
|
515
|
+
it 'is possible to access the full description regular expression' do
|
516
|
+
config.full_description = "foo"
|
517
|
+
expect(config.full_description).to eq(/foo/)
|
518
|
+
end
|
519
|
+
end
|
520
|
+
|
521
|
+
context "without full_description having been set" do
|
522
|
+
it 'returns nil from #full_description' do
|
523
|
+
expect(config.full_description).to eq nil
|
524
|
+
end
|
525
|
+
end
|
526
|
+
|
527
|
+
context "with line number" do
|
528
|
+
it "assigns the file and line number as a location filter" do
|
529
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:37"
|
530
|
+
expect(config.filter).to eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37]}})
|
531
|
+
end
|
532
|
+
|
533
|
+
it "assigns multiple files with line numbers as location filters" do
|
534
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:37", "other_spec.rb:44"
|
535
|
+
expect(config.filter).to eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37],
|
536
|
+
File.expand_path("other_spec.rb") => [44]}})
|
537
|
+
end
|
538
|
+
|
539
|
+
it "assigns files with multiple line numbers as location filters" do
|
540
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:37", "path/to/a_spec.rb:44"
|
541
|
+
expect(config.filter).to eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37, 44]}})
|
542
|
+
end
|
543
|
+
end
|
544
|
+
|
545
|
+
context "with multiple line numbers" do
|
546
|
+
it "assigns the file and line numbers as a location filter" do
|
547
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:1:3:5:7"
|
548
|
+
expect(config.filter).to eq({:locations => {File.expand_path("path/to/a_spec.rb") => [1,3,5,7]}})
|
549
|
+
end
|
550
|
+
end
|
551
|
+
|
552
|
+
it "assigns the example name as the filter on description" do
|
553
|
+
config.full_description = "foo"
|
554
|
+
expect(config.filter).to eq({:full_description => /foo/})
|
555
|
+
end
|
556
|
+
|
557
|
+
it "assigns the example names as the filter on description if description is an array" do
|
558
|
+
config.full_description = [ "foo", "bar" ]
|
559
|
+
expect(config.filter).to eq({:full_description => Regexp.union(/foo/, /bar/)})
|
560
|
+
end
|
561
|
+
|
562
|
+
it 'is possible to access the full description regular expression' do
|
563
|
+
config.full_description = "foo","bar"
|
564
|
+
expect(config.full_description).to eq Regexp.union(/foo/,/bar/)
|
565
|
+
end
|
566
|
+
|
567
|
+
describe "#default_path" do
|
568
|
+
it 'defaults to "spec"' do
|
569
|
+
expect(config.default_path).to eq('spec')
|
570
|
+
end
|
571
|
+
end
|
572
|
+
|
573
|
+
describe "#include" do
|
574
|
+
|
575
|
+
module InstanceLevelMethods
|
576
|
+
def you_call_this_a_blt?
|
577
|
+
"egad man, where's the mayo?!?!?"
|
578
|
+
end
|
579
|
+
end
|
580
|
+
|
581
|
+
it_behaves_like "metadata hash builder" do
|
582
|
+
def metadata_hash(*args)
|
583
|
+
config.include(InstanceLevelMethods, *args)
|
584
|
+
config.include_or_extend_modules.last.last
|
585
|
+
end
|
586
|
+
end
|
587
|
+
|
588
|
+
context "with no filter" do
|
589
|
+
it "includes the given module into each example group" do
|
590
|
+
RSpec.configure do |c|
|
591
|
+
c.include(InstanceLevelMethods)
|
592
|
+
end
|
593
|
+
|
594
|
+
group = ExampleGroup.describe('does like, stuff and junk', :magic_key => :include) { }
|
595
|
+
expect(group).not_to respond_to(:you_call_this_a_blt?)
|
596
|
+
expect(group.new.you_call_this_a_blt?).to eq("egad man, where's the mayo?!?!?")
|
597
|
+
end
|
598
|
+
end
|
599
|
+
|
600
|
+
context "with a filter" do
|
601
|
+
it "includes the given module into each matching example group" do
|
602
|
+
RSpec.configure do |c|
|
603
|
+
c.include(InstanceLevelMethods, :magic_key => :include)
|
604
|
+
end
|
605
|
+
|
606
|
+
group = ExampleGroup.describe('does like, stuff and junk', :magic_key => :include) { }
|
607
|
+
expect(group).not_to respond_to(:you_call_this_a_blt?)
|
608
|
+
expect(group.new.you_call_this_a_blt?).to eq("egad man, where's the mayo?!?!?")
|
609
|
+
end
|
610
|
+
end
|
611
|
+
|
612
|
+
end
|
613
|
+
|
614
|
+
describe "#extend" do
|
615
|
+
|
616
|
+
module ThatThingISentYou
|
617
|
+
def that_thing
|
618
|
+
end
|
619
|
+
end
|
620
|
+
|
621
|
+
it_behaves_like "metadata hash builder" do
|
622
|
+
def metadata_hash(*args)
|
623
|
+
config.extend(ThatThingISentYou, *args)
|
624
|
+
config.include_or_extend_modules.last.last
|
625
|
+
end
|
626
|
+
end
|
627
|
+
|
628
|
+
it "extends the given module into each matching example group" do
|
629
|
+
RSpec.configure do |c|
|
630
|
+
c.extend(ThatThingISentYou, :magic_key => :extend)
|
631
|
+
end
|
632
|
+
|
633
|
+
group = ExampleGroup.describe(ThatThingISentYou, :magic_key => :extend) { }
|
634
|
+
expect(group).to respond_to(:that_thing)
|
635
|
+
end
|
636
|
+
|
637
|
+
end
|
638
|
+
|
639
|
+
describe "#run_all_when_everything_filtered?" do
|
640
|
+
|
641
|
+
it "defaults to false" do
|
642
|
+
expect(config.run_all_when_everything_filtered?).to be_false
|
643
|
+
end
|
644
|
+
|
645
|
+
it "can be queried with question method" do
|
646
|
+
config.run_all_when_everything_filtered = true
|
647
|
+
expect(config.run_all_when_everything_filtered?).to be_true
|
648
|
+
end
|
649
|
+
end
|
650
|
+
|
651
|
+
%w[color color_enabled].each do |color_option|
|
652
|
+
describe "##{color_option}=" do
|
653
|
+
context "given true" do
|
654
|
+
before { config.send "#{color_option}=", true }
|
655
|
+
|
656
|
+
context "with config.tty? and output.tty?" do
|
657
|
+
it "does not set color_enabled" do
|
658
|
+
output = StringIO.new
|
659
|
+
config.output_stream = output
|
660
|
+
|
661
|
+
config.tty = true
|
662
|
+
config.output_stream.stub :tty? => true
|
663
|
+
|
664
|
+
expect(config.send(color_option)).to be_true
|
665
|
+
expect(config.send(color_option, output)).to be_true
|
666
|
+
end
|
667
|
+
end
|
668
|
+
|
669
|
+
context "with config.tty? and !output.tty?" do
|
670
|
+
it "sets color_enabled" do
|
671
|
+
output = StringIO.new
|
672
|
+
config.output_stream = output
|
673
|
+
|
674
|
+
config.tty = true
|
675
|
+
config.output_stream.stub :tty? => false
|
676
|
+
|
677
|
+
expect(config.send(color_option)).to be_true
|
678
|
+
expect(config.send(color_option, output)).to be_true
|
679
|
+
end
|
680
|
+
end
|
681
|
+
|
682
|
+
context "with config.tty? and !output.tty?" do
|
683
|
+
it "does not set color_enabled" do
|
684
|
+
output = StringIO.new
|
685
|
+
config.output_stream = output
|
686
|
+
|
687
|
+
config.tty = false
|
688
|
+
config.output_stream.stub :tty? => true
|
689
|
+
|
690
|
+
expect(config.send(color_option)).to be_true
|
691
|
+
expect(config.send(color_option, output)).to be_true
|
692
|
+
end
|
693
|
+
end
|
694
|
+
|
695
|
+
context "with !config.tty? and !output.tty?" do
|
696
|
+
it "does not set color_enabled" do
|
697
|
+
output = StringIO.new
|
698
|
+
config.output_stream = output
|
699
|
+
|
700
|
+
config.tty = false
|
701
|
+
config.output_stream.stub :tty? => false
|
702
|
+
|
703
|
+
expect(config.send(color_option)).to be_false
|
704
|
+
expect(config.send(color_option, output)).to be_false
|
705
|
+
end
|
706
|
+
end
|
707
|
+
|
708
|
+
context "on windows" do
|
709
|
+
before do
|
710
|
+
@original_host = RbConfig::CONFIG['host_os']
|
711
|
+
RbConfig::CONFIG['host_os'] = 'mingw'
|
712
|
+
config.stub(:require)
|
713
|
+
config.stub(:warn)
|
714
|
+
end
|
715
|
+
|
716
|
+
after do
|
717
|
+
RbConfig::CONFIG['host_os'] = @original_host
|
718
|
+
end
|
719
|
+
|
720
|
+
context "with ANSICON available" do
|
721
|
+
around(:each) { |e| with_env_vars('ANSICON' => 'ANSICON', &e) }
|
722
|
+
|
723
|
+
it "enables colors" do
|
724
|
+
config.output_stream = StringIO.new
|
725
|
+
config.output_stream.stub :tty? => true
|
726
|
+
config.send "#{color_option}=", true
|
727
|
+
expect(config.send(color_option)).to be_true
|
728
|
+
end
|
729
|
+
|
730
|
+
it "leaves output stream intact" do
|
731
|
+
config.output_stream = $stdout
|
732
|
+
config.stub(:require) do |what|
|
733
|
+
config.output_stream = 'foo' if what =~ /Win32/
|
734
|
+
end
|
735
|
+
config.send "#{color_option}=", true
|
736
|
+
expect(config.output_stream).to eq($stdout)
|
737
|
+
end
|
738
|
+
end
|
739
|
+
|
740
|
+
context "with ANSICON NOT available" do
|
741
|
+
it "warns to install ANSICON" do
|
742
|
+
config.stub(:require) { raise LoadError }
|
743
|
+
config.should_receive(:warn).
|
744
|
+
with(/You must use ANSICON/)
|
745
|
+
config.send "#{color_option}=", true
|
746
|
+
end
|
747
|
+
|
748
|
+
it "sets color_enabled to false" do
|
749
|
+
config.stub(:require) { raise LoadError }
|
750
|
+
config.send "#{color_option}=", true
|
751
|
+
config.color_enabled = true
|
752
|
+
expect(config.send(color_option)).to be_false
|
753
|
+
end
|
754
|
+
end
|
755
|
+
end
|
756
|
+
end
|
757
|
+
end
|
758
|
+
|
759
|
+
it "prefers incoming cli_args" do
|
760
|
+
config.output_stream = StringIO.new
|
761
|
+
config.output_stream.stub :tty? => true
|
762
|
+
config.force :color => true
|
763
|
+
config.color = false
|
764
|
+
expect(config.color).to be_true
|
765
|
+
end
|
766
|
+
end
|
767
|
+
|
768
|
+
describe '#formatter=' do
|
769
|
+
it "delegates to add_formatter (better API for user-facing configuration)" do
|
770
|
+
config.should_receive(:add_formatter).with('these','options')
|
771
|
+
config.add_formatter('these','options')
|
772
|
+
end
|
773
|
+
end
|
774
|
+
|
775
|
+
describe "#add_formatter" do
|
776
|
+
|
777
|
+
it "adds to the list of formatters" do
|
778
|
+
config.add_formatter :documentation
|
779
|
+
expect(config.formatters.first).to be_an_instance_of(Formatters::DocumentationFormatter)
|
780
|
+
end
|
781
|
+
|
782
|
+
it "finds a formatter by name (w/ Symbol)" do
|
783
|
+
config.add_formatter :documentation
|
784
|
+
expect(config.formatters.first).to be_an_instance_of(Formatters::DocumentationFormatter)
|
785
|
+
end
|
786
|
+
|
787
|
+
it "finds a formatter by name (w/ String)" do
|
788
|
+
config.add_formatter 'documentation'
|
789
|
+
expect(config.formatters.first).to be_an_instance_of(Formatters::DocumentationFormatter)
|
790
|
+
end
|
791
|
+
|
792
|
+
it "finds a formatter by class" do
|
793
|
+
formatter_class = Class.new(Formatters::BaseTextFormatter)
|
794
|
+
config.add_formatter formatter_class
|
795
|
+
expect(config.formatters.first).to be_an_instance_of(formatter_class)
|
796
|
+
end
|
797
|
+
|
798
|
+
it "finds a formatter by class name" do
|
799
|
+
stub_const("CustomFormatter", Class.new(Formatters::BaseFormatter))
|
800
|
+
config.add_formatter "CustomFormatter"
|
801
|
+
expect(config.formatters.first).to be_an_instance_of(CustomFormatter)
|
802
|
+
end
|
803
|
+
|
804
|
+
it "finds a formatter by class fully qualified name" do
|
805
|
+
stub_const("RSpec::CustomFormatter", Class.new(Formatters::BaseFormatter))
|
806
|
+
config.add_formatter "RSpec::CustomFormatter"
|
807
|
+
expect(config.formatters.first).to be_an_instance_of(RSpec::CustomFormatter)
|
808
|
+
end
|
809
|
+
|
810
|
+
it "requires a formatter file based on its fully qualified name" do
|
811
|
+
config.should_receive(:require).with('rspec/custom_formatter') do
|
812
|
+
stub_const("RSpec::CustomFormatter", Class.new(Formatters::BaseFormatter))
|
813
|
+
end
|
814
|
+
config.add_formatter "RSpec::CustomFormatter"
|
815
|
+
expect(config.formatters.first).to be_an_instance_of(RSpec::CustomFormatter)
|
816
|
+
end
|
817
|
+
|
818
|
+
it "raises NameError if class is unresolvable" do
|
819
|
+
config.should_receive(:require).with('rspec/custom_formatter3')
|
820
|
+
expect(lambda { config.add_formatter "RSpec::CustomFormatter3" }).to raise_error(NameError)
|
821
|
+
end
|
822
|
+
|
823
|
+
it "raises ArgumentError if formatter is unknown" do
|
824
|
+
expect(lambda { config.add_formatter :progresss }).to raise_error(ArgumentError)
|
825
|
+
end
|
826
|
+
|
827
|
+
context "with a 2nd arg defining the output" do
|
828
|
+
it "creates a file at that path and sets it as the output" do
|
829
|
+
path = File.join(Dir.tmpdir, 'output.txt')
|
830
|
+
config.add_formatter('doc', path)
|
831
|
+
expect(config.formatters.first.output).to be_a(File)
|
832
|
+
expect(config.formatters.first.output.path).to eq(path)
|
833
|
+
end
|
834
|
+
end
|
835
|
+
end
|
836
|
+
|
837
|
+
describe "#filter_run_including" do
|
838
|
+
it_behaves_like "metadata hash builder" do
|
839
|
+
def metadata_hash(*args)
|
840
|
+
config.filter_run_including(*args)
|
841
|
+
config.inclusion_filter
|
842
|
+
end
|
843
|
+
end
|
844
|
+
|
845
|
+
it "sets the filter with a hash" do
|
846
|
+
config.filter_run_including :foo => true
|
847
|
+
expect(config.inclusion_filter[:foo]).to be(true)
|
848
|
+
end
|
849
|
+
|
850
|
+
it "sets the filter with a symbol" do
|
851
|
+
RSpec.configuration.stub(:treat_symbols_as_metadata_keys_with_true_values? => true)
|
852
|
+
config.filter_run_including :foo
|
853
|
+
expect(config.inclusion_filter[:foo]).to be(true)
|
854
|
+
end
|
855
|
+
|
856
|
+
it "merges with existing filters" do
|
857
|
+
config.filter_run_including :foo => true
|
858
|
+
config.filter_run_including :bar => false
|
859
|
+
|
860
|
+
expect(config.inclusion_filter[:foo]).to be(true)
|
861
|
+
expect(config.inclusion_filter[:bar]).to be(false)
|
862
|
+
end
|
863
|
+
end
|
864
|
+
|
865
|
+
describe "#filter_run_excluding" do
|
866
|
+
it_behaves_like "metadata hash builder" do
|
867
|
+
def metadata_hash(*args)
|
868
|
+
config.filter_run_excluding(*args)
|
869
|
+
config.exclusion_filter
|
870
|
+
end
|
871
|
+
end
|
872
|
+
|
873
|
+
it "sets the filter" do
|
874
|
+
config.filter_run_excluding :foo => true
|
875
|
+
expect(config.exclusion_filter[:foo]).to be(true)
|
876
|
+
end
|
877
|
+
|
878
|
+
it "sets the filter using a symbol" do
|
879
|
+
RSpec.configuration.stub(:treat_symbols_as_metadata_keys_with_true_values? => true)
|
880
|
+
config.filter_run_excluding :foo
|
881
|
+
expect(config.exclusion_filter[:foo]).to be(true)
|
882
|
+
end
|
883
|
+
|
884
|
+
it "merges with existing filters" do
|
885
|
+
config.filter_run_excluding :foo => true
|
886
|
+
config.filter_run_excluding :bar => false
|
887
|
+
|
888
|
+
expect(config.exclusion_filter[:foo]).to be(true)
|
889
|
+
expect(config.exclusion_filter[:bar]).to be(false)
|
890
|
+
end
|
891
|
+
end
|
892
|
+
|
893
|
+
describe "#inclusion_filter" do
|
894
|
+
it "returns {} even if set to nil" do
|
895
|
+
config.inclusion_filter = nil
|
896
|
+
expect(config.inclusion_filter).to eq({})
|
897
|
+
end
|
898
|
+
end
|
899
|
+
|
900
|
+
describe "#inclusion_filter=" do
|
901
|
+
it "treats symbols as hash keys with true values when told to" do
|
902
|
+
RSpec.configuration.stub(:treat_symbols_as_metadata_keys_with_true_values? => true)
|
903
|
+
config.inclusion_filter = :foo
|
904
|
+
expect(config.inclusion_filter).to eq({:foo => true})
|
905
|
+
end
|
906
|
+
|
907
|
+
it "overrides any inclusion filters set on the command line or in configuration files" do
|
908
|
+
config.force(:inclusion_filter => { :foo => :bar })
|
909
|
+
config.inclusion_filter = {:want => :this}
|
910
|
+
expect(config.inclusion_filter).to eq({:want => :this})
|
911
|
+
end
|
912
|
+
end
|
913
|
+
|
914
|
+
describe "#exclusion_filter" do
|
915
|
+
it "returns {} even if set to nil" do
|
916
|
+
config.exclusion_filter = nil
|
917
|
+
expect(config.exclusion_filter).to eq({})
|
918
|
+
end
|
919
|
+
|
920
|
+
describe "the default :if filter" do
|
921
|
+
it "does not exclude a spec with { :if => true } metadata" do
|
922
|
+
expect(config.exclusion_filter[:if].call(true)).to be_false
|
923
|
+
end
|
924
|
+
|
925
|
+
it "excludes a spec with { :if => false } metadata" do
|
926
|
+
expect(config.exclusion_filter[:if].call(false)).to be_true
|
927
|
+
end
|
928
|
+
|
929
|
+
it "excludes a spec with { :if => nil } metadata" do
|
930
|
+
expect(config.exclusion_filter[:if].call(nil)).to be_true
|
931
|
+
end
|
932
|
+
end
|
933
|
+
|
934
|
+
describe "the default :unless filter" do
|
935
|
+
it "excludes a spec with { :unless => true } metadata" do
|
936
|
+
expect(config.exclusion_filter[:unless].call(true)).to be_true
|
937
|
+
end
|
938
|
+
|
939
|
+
it "does not exclude a spec with { :unless => false } metadata" do
|
940
|
+
expect(config.exclusion_filter[:unless].call(false)).to be_false
|
941
|
+
end
|
942
|
+
|
943
|
+
it "does not exclude a spec with { :unless => nil } metadata" do
|
944
|
+
expect(config.exclusion_filter[:unless].call(nil)).to be_false
|
945
|
+
end
|
946
|
+
end
|
947
|
+
end
|
948
|
+
|
949
|
+
describe "#exclusion_filter=" do
|
950
|
+
it "treats symbols as hash keys with true values when told to" do
|
951
|
+
RSpec.configuration.stub(:treat_symbols_as_metadata_keys_with_true_values? => true)
|
952
|
+
config.exclusion_filter = :foo
|
953
|
+
expect(config.exclusion_filter).to eq({:foo => true})
|
954
|
+
end
|
955
|
+
|
956
|
+
it "overrides any exclusion filters set on the command line or in configuration files" do
|
957
|
+
config.force(:exclusion_filter => { :foo => :bar })
|
958
|
+
config.exclusion_filter = {:want => :this}
|
959
|
+
expect(config.exclusion_filter).to eq({:want => :this})
|
960
|
+
end
|
961
|
+
end
|
962
|
+
|
963
|
+
describe "line_numbers=" do
|
964
|
+
before { config.filter_manager.stub(:warn) }
|
965
|
+
|
966
|
+
it "sets the line numbers" do
|
967
|
+
config.line_numbers = ['37']
|
968
|
+
expect(config.filter).to eq({:line_numbers => [37]})
|
969
|
+
end
|
970
|
+
|
971
|
+
it "overrides filters" do
|
972
|
+
config.filter_run :focused => true
|
973
|
+
config.line_numbers = ['37']
|
974
|
+
expect(config.filter).to eq({:line_numbers => [37]})
|
975
|
+
end
|
976
|
+
|
977
|
+
it "prevents subsequent filters" do
|
978
|
+
config.line_numbers = ['37']
|
979
|
+
config.filter_run :focused => true
|
980
|
+
expect(config.filter).to eq({:line_numbers => [37]})
|
981
|
+
end
|
982
|
+
end
|
983
|
+
|
984
|
+
describe "line_numbers" do
|
985
|
+
it "returns the line numbers from the filter" do
|
986
|
+
config.line_numbers = ['42']
|
987
|
+
expect(config.line_numbers).to eq [42]
|
988
|
+
end
|
989
|
+
|
990
|
+
it "defaults to empty" do
|
991
|
+
expect(config.line_numbers).to eq []
|
992
|
+
end
|
993
|
+
end
|
994
|
+
|
995
|
+
describe "#full_backtrace=" do
|
996
|
+
context "given true" do
|
997
|
+
it "clears the backtrace exclusion patterns" do
|
998
|
+
config.full_backtrace = true
|
999
|
+
expect(config.backtrace_exclusion_patterns).to eq([])
|
1000
|
+
end
|
1001
|
+
end
|
1002
|
+
|
1003
|
+
context "given false" do
|
1004
|
+
it "restores backtrace clean patterns" do
|
1005
|
+
config.full_backtrace = false
|
1006
|
+
expect(config.backtrace_exclusion_patterns).to eq(RSpec::Core::BacktraceCleaner::DEFAULT_EXCLUSION_PATTERNS)
|
1007
|
+
end
|
1008
|
+
end
|
1009
|
+
|
1010
|
+
it "doesn't impact other instances of config" do
|
1011
|
+
config_1 = Configuration.new
|
1012
|
+
config_2 = Configuration.new
|
1013
|
+
|
1014
|
+
config_1.full_backtrace = true
|
1015
|
+
expect(config_2.backtrace_exclusion_patterns).not_to be_empty
|
1016
|
+
end
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
describe "#backtrace_clean_patterns=" do
|
1020
|
+
it "actually receives the new filter values" do
|
1021
|
+
RSpec.stub(:deprecate)
|
1022
|
+
config = Configuration.new
|
1023
|
+
config.backtrace_clean_patterns = [/.*/]
|
1024
|
+
expect(config.backtrace_cleaner.exclude? "this").to be_true
|
1025
|
+
end
|
1026
|
+
end
|
1027
|
+
|
1028
|
+
describe 'full_backtrace' do
|
1029
|
+
it 'returns true when backtrace patterns is empty' do
|
1030
|
+
config.backtrace_exclusion_patterns = []
|
1031
|
+
expect(config.full_backtrace?).to eq true
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
it 'returns false when backtrace patterns isnt empty' do
|
1035
|
+
config.backtrace_exclusion_patterns = [:lib]
|
1036
|
+
expect(config.full_backtrace?).to eq false
|
1037
|
+
end
|
1038
|
+
end
|
1039
|
+
|
1040
|
+
describe "#backtrace_clean_patterns" do
|
1041
|
+
before { allow(RSpec).to receive(:deprecate) }
|
1042
|
+
it "is deprecated" do
|
1043
|
+
RSpec.should_receive(:deprecate)
|
1044
|
+
config = Configuration.new
|
1045
|
+
config.backtrace_clean_patterns
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
it "can be appended to" do
|
1049
|
+
config = Configuration.new
|
1050
|
+
config.backtrace_clean_patterns << /.*/
|
1051
|
+
expect(config.backtrace_cleaner.exclude? "this").to be_true
|
1052
|
+
end
|
1053
|
+
end
|
1054
|
+
|
1055
|
+
describe ".backtrace_cleaner#exclude? defaults" do
|
1056
|
+
it "returns true for rspec files" do
|
1057
|
+
expect(config.backtrace_cleaner.exclude?("lib/rspec/core.rb")).to be_true
|
1058
|
+
end
|
1059
|
+
|
1060
|
+
it "returns true for spec_helper" do
|
1061
|
+
expect(config.backtrace_cleaner.exclude?("spec/spec_helper.rb")).to be_true
|
1062
|
+
end
|
1063
|
+
|
1064
|
+
it "returns true for java files (for JRuby)" do
|
1065
|
+
expect(config.backtrace_cleaner.exclude?("org/jruby/RubyArray.java:2336")).to be_true
|
1066
|
+
end
|
1067
|
+
|
1068
|
+
it "returns true for files within installed gems" do
|
1069
|
+
expect(config.backtrace_cleaner.exclude?('ruby-1.8.7-p334/gems/mygem-2.3.0/lib/mygem.rb')).to be_true
|
1070
|
+
end
|
1071
|
+
|
1072
|
+
it "returns false for files in projects containing 'gems' in the name" do
|
1073
|
+
expect(config.backtrace_cleaner.exclude?('code/my-gems-plugin/lib/plugin.rb')).to be_false
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
it "returns false for something in the current working directory" do
|
1077
|
+
expect(config.backtrace_cleaner.exclude?("#{Dir.getwd}/arbitrary")).to be_false
|
1078
|
+
end
|
1079
|
+
end
|
1080
|
+
|
1081
|
+
describe "#debug=true" do
|
1082
|
+
before do
|
1083
|
+
if defined?(Debugger)
|
1084
|
+
@orig_debugger = Debugger
|
1085
|
+
Object.send(:remove_const, :Debugger)
|
1086
|
+
else
|
1087
|
+
@orig_debugger = nil
|
1088
|
+
end
|
1089
|
+
config.stub(:require)
|
1090
|
+
Object.const_set("Debugger", debugger)
|
1091
|
+
end
|
1092
|
+
|
1093
|
+
after do
|
1094
|
+
Object.send(:remove_const, :Debugger)
|
1095
|
+
Object.const_set("Debugger", @orig_debugger) if @orig_debugger
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
let(:debugger) { double('Debugger').as_null_object }
|
1099
|
+
|
1100
|
+
it "requires 'ruby-debug'" do
|
1101
|
+
config.should_receive(:require).with('ruby-debug')
|
1102
|
+
config.debug = true
|
1103
|
+
end
|
1104
|
+
|
1105
|
+
it "starts the debugger" do
|
1106
|
+
debugger.should_receive(:start)
|
1107
|
+
config.debug = true
|
1108
|
+
end
|
1109
|
+
end
|
1110
|
+
|
1111
|
+
describe "#debug=false" do
|
1112
|
+
it "does not require 'ruby-debug'" do
|
1113
|
+
config.should_not_receive(:require).with('ruby-debug')
|
1114
|
+
config.debug = false
|
1115
|
+
end
|
1116
|
+
end
|
1117
|
+
|
1118
|
+
describe "#debug?" do
|
1119
|
+
it 'returns true if the debugger has been loaded' do
|
1120
|
+
stub_const("Debugger", Object.new)
|
1121
|
+
expect(config.debug?).to be_true
|
1122
|
+
end
|
1123
|
+
|
1124
|
+
it 'returns false if the debugger has not been loaded' do
|
1125
|
+
hide_const("Debugger")
|
1126
|
+
expect(config.debug?).to be_false
|
1127
|
+
end
|
1128
|
+
end
|
1129
|
+
|
1130
|
+
describe "#output=" do
|
1131
|
+
it "sets the output" do
|
1132
|
+
output = double("output")
|
1133
|
+
config.output = output
|
1134
|
+
expect(config.output).to equal(output)
|
1135
|
+
end
|
1136
|
+
end
|
1137
|
+
|
1138
|
+
describe "#libs=" do
|
1139
|
+
include_context "isolate load path mutation"
|
1140
|
+
|
1141
|
+
it "adds directories to the LOAD_PATH" do
|
1142
|
+
$LOAD_PATH.should_receive(:unshift).with("a/dir")
|
1143
|
+
config.libs = ["a/dir"]
|
1144
|
+
end
|
1145
|
+
end
|
1146
|
+
|
1147
|
+
describe "libs" do
|
1148
|
+
include_context "isolate load path mutation"
|
1149
|
+
|
1150
|
+
it 'records paths added to the load path' do
|
1151
|
+
config.libs = ["a/dir"]
|
1152
|
+
expect(config.libs).to eq ["a/dir"]
|
1153
|
+
end
|
1154
|
+
end
|
1155
|
+
|
1156
|
+
describe "#requires=" do
|
1157
|
+
before { RSpec.should_receive :deprecate }
|
1158
|
+
|
1159
|
+
it "requires the configured files" do
|
1160
|
+
config.should_receive(:require).with('foo').ordered
|
1161
|
+
config.should_receive(:require).with('bar').ordered
|
1162
|
+
config.requires = ['foo', 'bar']
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
it "stores require paths" do
|
1166
|
+
config.should_receive(:require).with("a/path")
|
1167
|
+
config.requires = ["a/path"]
|
1168
|
+
expect(config.requires).to eq ['a/path']
|
1169
|
+
end
|
1170
|
+
end
|
1171
|
+
|
1172
|
+
describe "#add_setting" do
|
1173
|
+
describe "with no modifiers" do
|
1174
|
+
context "with no additional options" do
|
1175
|
+
before do
|
1176
|
+
config.add_setting :custom_option
|
1177
|
+
end
|
1178
|
+
|
1179
|
+
it "defaults to nil" do
|
1180
|
+
expect(config.custom_option).to be_nil
|
1181
|
+
end
|
1182
|
+
|
1183
|
+
it "adds a predicate" do
|
1184
|
+
expect(config.custom_option?).to be_false
|
1185
|
+
end
|
1186
|
+
|
1187
|
+
it "can be overridden" do
|
1188
|
+
config.custom_option = "a value"
|
1189
|
+
expect(config.custom_option).to eq("a value")
|
1190
|
+
end
|
1191
|
+
end
|
1192
|
+
|
1193
|
+
context "with :default => 'a value'" do
|
1194
|
+
before do
|
1195
|
+
config.add_setting :custom_option, :default => 'a value'
|
1196
|
+
end
|
1197
|
+
|
1198
|
+
it "defaults to 'a value'" do
|
1199
|
+
expect(config.custom_option).to eq("a value")
|
1200
|
+
end
|
1201
|
+
|
1202
|
+
it "returns true for the predicate" do
|
1203
|
+
expect(config.custom_option?).to be_true
|
1204
|
+
end
|
1205
|
+
|
1206
|
+
it "can be overridden with a truthy value" do
|
1207
|
+
config.custom_option = "a new value"
|
1208
|
+
expect(config.custom_option).to eq("a new value")
|
1209
|
+
end
|
1210
|
+
|
1211
|
+
it "can be overridden with nil" do
|
1212
|
+
config.custom_option = nil
|
1213
|
+
expect(config.custom_option).to eq(nil)
|
1214
|
+
end
|
1215
|
+
|
1216
|
+
it "can be overridden with false" do
|
1217
|
+
config.custom_option = false
|
1218
|
+
expect(config.custom_option).to eq(false)
|
1219
|
+
end
|
1220
|
+
end
|
1221
|
+
end
|
1222
|
+
|
1223
|
+
context "with :alias => " do
|
1224
|
+
it "is deprecated" do
|
1225
|
+
RSpec::should_receive(:deprecate).with(/:alias option/, :replacement => ":alias_with")
|
1226
|
+
config.add_setting :custom_option
|
1227
|
+
config.add_setting :another_custom_option, :alias => :custom_option
|
1228
|
+
end
|
1229
|
+
end
|
1230
|
+
|
1231
|
+
context "with :alias_with => " do
|
1232
|
+
before do
|
1233
|
+
config.add_setting :custom_option, :alias_with => :another_custom_option
|
1234
|
+
end
|
1235
|
+
|
1236
|
+
it "delegates the getter to the other option" do
|
1237
|
+
config.another_custom_option = "this value"
|
1238
|
+
expect(config.custom_option).to eq("this value")
|
1239
|
+
end
|
1240
|
+
|
1241
|
+
it "delegates the setter to the other option" do
|
1242
|
+
config.custom_option = "this value"
|
1243
|
+
expect(config.another_custom_option).to eq("this value")
|
1244
|
+
end
|
1245
|
+
|
1246
|
+
it "delegates the predicate to the other option" do
|
1247
|
+
config.custom_option = true
|
1248
|
+
expect(config.another_custom_option?).to be_true
|
1249
|
+
end
|
1250
|
+
end
|
1251
|
+
end
|
1252
|
+
|
1253
|
+
describe "#configure_group" do
|
1254
|
+
it "extends with 'extend'" do
|
1255
|
+
mod = Module.new
|
1256
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1257
|
+
|
1258
|
+
config.extend(mod, :foo => :bar)
|
1259
|
+
config.configure_group(group)
|
1260
|
+
expect(group).to be_a(mod)
|
1261
|
+
end
|
1262
|
+
|
1263
|
+
it "extends with 'module'" do
|
1264
|
+
mod = Module.new
|
1265
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1266
|
+
|
1267
|
+
config.include(mod, :foo => :bar)
|
1268
|
+
config.configure_group(group)
|
1269
|
+
expect(group.included_modules).to include(mod)
|
1270
|
+
end
|
1271
|
+
|
1272
|
+
it "requires only one matching filter" do
|
1273
|
+
mod = Module.new
|
1274
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1275
|
+
|
1276
|
+
config.include(mod, :foo => :bar, :baz => :bam)
|
1277
|
+
config.configure_group(group)
|
1278
|
+
expect(group.included_modules).to include(mod)
|
1279
|
+
end
|
1280
|
+
|
1281
|
+
it "includes each one before deciding whether to include the next" do
|
1282
|
+
mod1 = Module.new do
|
1283
|
+
def self.included(host)
|
1284
|
+
host.metadata[:foo] = :bar
|
1285
|
+
end
|
1286
|
+
end
|
1287
|
+
mod2 = Module.new
|
1288
|
+
|
1289
|
+
group = ExampleGroup.describe("group")
|
1290
|
+
|
1291
|
+
config.include(mod1)
|
1292
|
+
config.include(mod2, :foo => :bar)
|
1293
|
+
config.configure_group(group)
|
1294
|
+
expect(group.included_modules).to include(mod1)
|
1295
|
+
expect(group.included_modules).to include(mod2)
|
1296
|
+
end
|
1297
|
+
|
1298
|
+
module IncludeOrExtendMeOnce
|
1299
|
+
def self.included(host)
|
1300
|
+
raise "included again" if host.instance_methods.include?(:foobar)
|
1301
|
+
host.class_eval { def foobar; end }
|
1302
|
+
end
|
1303
|
+
|
1304
|
+
def self.extended(host)
|
1305
|
+
raise "extended again" if host.respond_to?(:foobar)
|
1306
|
+
def host.foobar; end
|
1307
|
+
end
|
1308
|
+
end
|
1309
|
+
|
1310
|
+
it "doesn't include a module when already included in ancestor" do
|
1311
|
+
config.include(IncludeOrExtendMeOnce, :foo => :bar)
|
1312
|
+
|
1313
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1314
|
+
child = group.describe("child")
|
1315
|
+
|
1316
|
+
config.configure_group(group)
|
1317
|
+
config.configure_group(child)
|
1318
|
+
end
|
1319
|
+
|
1320
|
+
it "doesn't extend when ancestor is already extended with same module" do
|
1321
|
+
config.extend(IncludeOrExtendMeOnce, :foo => :bar)
|
1322
|
+
|
1323
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1324
|
+
child = group.describe("child")
|
1325
|
+
|
1326
|
+
config.configure_group(group)
|
1327
|
+
config.configure_group(child)
|
1328
|
+
end
|
1329
|
+
end
|
1330
|
+
|
1331
|
+
describe "#alias_example_to" do
|
1332
|
+
it_behaves_like "metadata hash builder" do
|
1333
|
+
after do
|
1334
|
+
RSpec::Core::ExampleGroup.module_eval do
|
1335
|
+
class << self
|
1336
|
+
undef :my_example_method if method_defined? :my_example_method
|
1337
|
+
end
|
1338
|
+
end
|
1339
|
+
end
|
1340
|
+
def metadata_hash(*args)
|
1341
|
+
config.alias_example_to :my_example_method, *args
|
1342
|
+
group = ExampleGroup.describe("group")
|
1343
|
+
example = group.my_example_method("description")
|
1344
|
+
example.metadata
|
1345
|
+
end
|
1346
|
+
end
|
1347
|
+
end
|
1348
|
+
|
1349
|
+
describe "#reset" do
|
1350
|
+
it "clears the reporter" do
|
1351
|
+
expect(config.reporter).not_to be_nil
|
1352
|
+
config.reset
|
1353
|
+
expect(config.instance_variable_get("@reporter")).to be_nil
|
1354
|
+
end
|
1355
|
+
|
1356
|
+
it "clears the formatters" do
|
1357
|
+
config.add_formatter "doc"
|
1358
|
+
config.reset
|
1359
|
+
expect(config.formatters).to be_empty
|
1360
|
+
end
|
1361
|
+
end
|
1362
|
+
|
1363
|
+
describe "#force" do
|
1364
|
+
it "forces order" do
|
1365
|
+
config.force :order => "default"
|
1366
|
+
config.order = "rand"
|
1367
|
+
expect(config.order).to eq("default")
|
1368
|
+
end
|
1369
|
+
|
1370
|
+
it "forces order and seed with :order => 'rand:37'" do
|
1371
|
+
config.force :order => "rand:37"
|
1372
|
+
config.order = "default"
|
1373
|
+
expect(config.order).to eq("rand")
|
1374
|
+
expect(config.seed).to eq(37)
|
1375
|
+
end
|
1376
|
+
|
1377
|
+
it "forces order and seed with :seed => '37'" do
|
1378
|
+
config.force :seed => "37"
|
1379
|
+
config.order = "default"
|
1380
|
+
expect(config.seed).to eq(37)
|
1381
|
+
expect(config.order).to eq("rand")
|
1382
|
+
end
|
1383
|
+
|
1384
|
+
it 'can set random ordering' do
|
1385
|
+
config.force :seed => "rand:37"
|
1386
|
+
RSpec.stub(:configuration => config)
|
1387
|
+
list = [1, 2, 3, 4].extend(Extensions::Ordered::Examples)
|
1388
|
+
Kernel.should_receive(:rand).and_return(3, 1, 4, 2)
|
1389
|
+
expect(list.ordered).to eq([2, 4, 1, 3])
|
1390
|
+
end
|
1391
|
+
|
1392
|
+
it "forces 'false' value" do
|
1393
|
+
config.add_setting :custom_option
|
1394
|
+
config.custom_option = true
|
1395
|
+
expect(config.custom_option?).to be_true
|
1396
|
+
config.force :custom_option => false
|
1397
|
+
expect(config.custom_option?).to be_false
|
1398
|
+
config.custom_option = true
|
1399
|
+
expect(config.custom_option?).to be_false
|
1400
|
+
end
|
1401
|
+
end
|
1402
|
+
|
1403
|
+
describe '#seed' do
|
1404
|
+
it 'returns the seed as an int' do
|
1405
|
+
config.seed = '123'
|
1406
|
+
expect(config.seed).to eq(123)
|
1407
|
+
end
|
1408
|
+
end
|
1409
|
+
|
1410
|
+
describe '#randomize?' do
|
1411
|
+
context 'with order set to :random' do
|
1412
|
+
before { config.order = :random }
|
1413
|
+
|
1414
|
+
it 'returns true' do
|
1415
|
+
expect(config.randomize?).to be_true
|
1416
|
+
end
|
1417
|
+
end
|
1418
|
+
|
1419
|
+
context 'with order set to nil' do
|
1420
|
+
before { config.order = nil }
|
1421
|
+
|
1422
|
+
it 'returns false' do
|
1423
|
+
expect(config.randomize?).to be_false
|
1424
|
+
end
|
1425
|
+
end
|
1426
|
+
end
|
1427
|
+
|
1428
|
+
describe '#order=' do
|
1429
|
+
context 'given "random:123"' do
|
1430
|
+
before { config.order = 'random:123' }
|
1431
|
+
|
1432
|
+
it 'sets order to "random"' do
|
1433
|
+
expect(config.order).to eq('random')
|
1434
|
+
end
|
1435
|
+
|
1436
|
+
it 'sets seed to 123' do
|
1437
|
+
expect(config.seed).to eq(123)
|
1438
|
+
end
|
1439
|
+
|
1440
|
+
it 'sets up random ordering' do
|
1441
|
+
RSpec.stub(:configuration => config)
|
1442
|
+
list = [1, 2, 3, 4].extend(Extensions::Ordered::Examples)
|
1443
|
+
Kernel.should_receive(:rand).and_return(3, 1, 4, 2)
|
1444
|
+
expect(list.ordered).to eq([2, 4, 1, 3])
|
1445
|
+
end
|
1446
|
+
end
|
1447
|
+
|
1448
|
+
context 'given "default"' do
|
1449
|
+
before do
|
1450
|
+
config.order = 'rand:123'
|
1451
|
+
config.order = 'default'
|
1452
|
+
end
|
1453
|
+
|
1454
|
+
it "sets the order to nil" do
|
1455
|
+
expect(config.order).to be_nil
|
1456
|
+
end
|
1457
|
+
|
1458
|
+
it "sets the seed to nil" do
|
1459
|
+
expect(config.seed).to be_nil
|
1460
|
+
end
|
1461
|
+
|
1462
|
+
it 'clears the random ordering' do
|
1463
|
+
RSpec.stub(:configuration => config)
|
1464
|
+
list = [1, 2, 3, 4].extend(Extensions::Ordered::Examples)
|
1465
|
+
Kernel.should_not_receive(:rand)
|
1466
|
+
expect(list.ordered).to eq([1, 2, 3, 4])
|
1467
|
+
end
|
1468
|
+
end
|
1469
|
+
end
|
1470
|
+
|
1471
|
+
describe "#order_examples" do
|
1472
|
+
before { RSpec.stub(:configuration => config) }
|
1473
|
+
|
1474
|
+
it 'sets a block that determines the ordering of a collection extended with Extensions::Ordered::Examples' do
|
1475
|
+
examples = [1, 2, 3, 4]
|
1476
|
+
examples.extend Extensions::Ordered::Examples
|
1477
|
+
config.order_examples { |examples_to_order| examples_to_order.reverse }
|
1478
|
+
expect(examples.ordered).to eq([4, 3, 2, 1])
|
1479
|
+
end
|
1480
|
+
|
1481
|
+
it 'sets #order to "custom"' do
|
1482
|
+
config.order_examples { |examples| examples.reverse }
|
1483
|
+
expect(config.order).to eq("custom")
|
1484
|
+
end
|
1485
|
+
end
|
1486
|
+
|
1487
|
+
describe "#example_ordering_block" do
|
1488
|
+
it 'defaults to a block that returns the passed argument' do
|
1489
|
+
expect(config.example_ordering_block.call([1, 2, 3])).to eq([1, 2, 3])
|
1490
|
+
end
|
1491
|
+
end
|
1492
|
+
|
1493
|
+
describe "#order_groups" do
|
1494
|
+
before { RSpec.stub(:configuration => config) }
|
1495
|
+
|
1496
|
+
it 'sets a block that determines the ordering of a collection extended with Extensions::Ordered::ExampleGroups' do
|
1497
|
+
groups = [1, 2, 3, 4]
|
1498
|
+
groups.extend Extensions::Ordered::ExampleGroups
|
1499
|
+
config.order_groups { |groups_to_order| groups_to_order.reverse }
|
1500
|
+
expect(groups.ordered).to eq([4, 3, 2, 1])
|
1501
|
+
end
|
1502
|
+
|
1503
|
+
it 'sets #order to "custom"' do
|
1504
|
+
config.order_groups { |groups| groups.reverse }
|
1505
|
+
expect(config.order).to eq("custom")
|
1506
|
+
end
|
1507
|
+
end
|
1508
|
+
|
1509
|
+
describe "#group_ordering_block" do
|
1510
|
+
it 'defaults to a block that returns the passed argument' do
|
1511
|
+
expect(config.group_ordering_block.call([1, 2, 3])).to eq([1, 2, 3])
|
1512
|
+
end
|
1513
|
+
end
|
1514
|
+
|
1515
|
+
describe "#order_groups_and_examples" do
|
1516
|
+
let(:examples) { [1, 2, 3, 4].extend Extensions::Ordered::Examples }
|
1517
|
+
let(:groups) { [1, 2, 3, 4].extend Extensions::Ordered::ExampleGroups }
|
1518
|
+
|
1519
|
+
before do
|
1520
|
+
RSpec.stub(:configuration => config)
|
1521
|
+
config.order_groups_and_examples { |list| list.reverse }
|
1522
|
+
end
|
1523
|
+
|
1524
|
+
it 'sets a block that determines the ordering of a collection extended with Extensions::Ordered::Examples' do
|
1525
|
+
expect(examples.ordered).to eq([4, 3, 2, 1])
|
1526
|
+
end
|
1527
|
+
|
1528
|
+
it 'sets a block that determines the ordering of a collection extended with Extensions::Ordered::ExampleGroups' do
|
1529
|
+
expect(groups.ordered).to eq([4, 3, 2, 1])
|
1530
|
+
end
|
1531
|
+
end
|
1532
|
+
|
1533
|
+
describe '#warnings' do
|
1534
|
+
around do |example|
|
1535
|
+
@_original_setting = $VERBOSE
|
1536
|
+
example.run
|
1537
|
+
$VERBOSE = @_original_setting
|
1538
|
+
end
|
1539
|
+
|
1540
|
+
it "sets verbose to true when true" do
|
1541
|
+
config.warnings = true
|
1542
|
+
expect($VERBOSE).to eq true
|
1543
|
+
end
|
1544
|
+
|
1545
|
+
it "sets verbose to false when true" do
|
1546
|
+
config.warnings = false
|
1547
|
+
expect($VERBOSE).to eq false
|
1548
|
+
end
|
1549
|
+
|
1550
|
+
it 'returns the verbosity setting' do
|
1551
|
+
expect(config.warnings).to eq $VERBOSE
|
1552
|
+
end
|
1553
|
+
|
1554
|
+
it 'is loaded from config by #force' do
|
1555
|
+
config.force :warnings => true
|
1556
|
+
expect($VERBOSE).to eq true
|
1557
|
+
end
|
1558
|
+
end
|
1559
|
+
|
1560
|
+
end
|
1561
|
+
end
|