gem_repackager 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +56 -0
- data/Rakefile +9 -0
- data/bin/gem_repackager +57 -0
- data/gem_repackager.gemspec +22 -0
- data/lib/gem_repackager.rb +131 -0
- data/lib/gem_repackager/version.rb +5 -0
- data/spec/packager_spec.rb +131 -0
- data/spec/spec_helper.rb +1 -0
- data/support/bin/rspec +19 -0
- data/support/gems/rspec-2.11.0/License.txt +24 -0
- data/support/gems/rspec-2.11.0/README.md +47 -0
- data/support/gems/rspec-2.11.0/lib/rspec.rb +4 -0
- data/support/gems/rspec-2.11.0/lib/rspec/version.rb +5 -0
- data/support/gems/rspec-core-2.11.1/.document +5 -0
- data/support/gems/rspec-core-2.11.1/.yardopts +6 -0
- data/support/gems/rspec-core-2.11.1/Changelog.md +570 -0
- data/support/gems/rspec-core-2.11.1/License.txt +24 -0
- data/support/gems/rspec-core-2.11.1/README.md +235 -0
- data/support/gems/rspec-core-2.11.1/exe/autospec +13 -0
- data/support/gems/rspec-core-2.11.1/exe/rspec +25 -0
- data/support/gems/rspec-core-2.11.1/features/Autotest.md +38 -0
- data/support/gems/rspec-core-2.11.1/features/README.md +17 -0
- data/support/gems/rspec-core-2.11.1/features/Upgrade.md +364 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/README.md +28 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/example_name_option.feature +101 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/exit_status.feature +83 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/format_option.feature +81 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/init.feature +18 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/line_number_appended_to_path.feature +140 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/line_number_option.feature +58 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/order.feature +29 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/pattern_option.feature +31 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/rake_task.feature +68 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/ruby.feature +22 -0
- data/support/gems/rspec-core-2.11.1/features/command_line/tag.feature +91 -0
- data/support/gems/rspec-core-2.11.1/features/configuration/alias_example_to.feature +48 -0
- data/support/gems/rspec-core-2.11.1/features/configuration/custom_settings.feature +84 -0
- data/support/gems/rspec-core-2.11.1/features/configuration/default_path.feature +38 -0
- data/support/gems/rspec-core-2.11.1/features/configuration/fail_fast.feature +77 -0
- data/support/gems/rspec-core-2.11.1/features/configuration/read_options_from_file.feature +87 -0
- data/support/gems/rspec-core-2.11.1/features/example_groups/basic_structure.feature +55 -0
- data/support/gems/rspec-core-2.11.1/features/example_groups/shared_context.feature +74 -0
- data/support/gems/rspec-core-2.11.1/features/example_groups/shared_examples.feature +204 -0
- data/support/gems/rspec-core-2.11.1/features/expectation_framework_integration/configure_expectation_framework.feature +102 -0
- data/support/gems/rspec-core-2.11.1/features/filtering/exclusion_filters.feature +139 -0
- data/support/gems/rspec-core-2.11.1/features/filtering/if_and_unless.feature +168 -0
- data/support/gems/rspec-core-2.11.1/features/filtering/inclusion_filters.feature +105 -0
- data/support/gems/rspec-core-2.11.1/features/filtering/run_all_when_everything_filtered.feature +46 -0
- data/support/gems/rspec-core-2.11.1/features/formatters/custom_formatter.feature +36 -0
- data/support/gems/rspec-core-2.11.1/features/formatters/text_formatter.feature +46 -0
- data/support/gems/rspec-core-2.11.1/features/helper_methods/arbitrary_methods.feature +40 -0
- data/support/gems/rspec-core-2.11.1/features/helper_methods/let.feature +50 -0
- data/support/gems/rspec-core-2.11.1/features/helper_methods/modules.feature +149 -0
- data/support/gems/rspec-core-2.11.1/features/hooks/around_hooks.feature +343 -0
- data/support/gems/rspec-core-2.11.1/features/hooks/before_and_after_hooks.feature +423 -0
- data/support/gems/rspec-core-2.11.1/features/hooks/filtering.feature +234 -0
- data/support/gems/rspec-core-2.11.1/features/metadata/current_example.feature +17 -0
- data/support/gems/rspec-core-2.11.1/features/metadata/described_class.feature +17 -0
- data/support/gems/rspec-core-2.11.1/features/metadata/user_defined.feature +113 -0
- data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_any_framework.feature +106 -0
- data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_flexmock.feature +96 -0
- data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_mocha.feature +97 -0
- data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_rr.feature +98 -0
- data/support/gems/rspec-core-2.11.1/features/mock_framework_integration/use_rspec.feature +97 -0
- data/support/gems/rspec-core-2.11.1/features/pending/pending_examples.feature +229 -0
- data/support/gems/rspec-core-2.11.1/features/spec_files/arbitrary_file_suffix.feature +13 -0
- data/support/gems/rspec-core-2.11.1/features/step_definitions/additional_cli_steps.rb +30 -0
- data/support/gems/rspec-core-2.11.1/features/subject/attribute_of_subject.feature +124 -0
- data/support/gems/rspec-core-2.11.1/features/subject/explicit_subject.feature +82 -0
- data/support/gems/rspec-core-2.11.1/features/subject/implicit_receiver.feature +29 -0
- data/support/gems/rspec-core-2.11.1/features/subject/implicit_subject.feature +63 -0
- data/support/gems/rspec-core-2.11.1/features/support/env.rb +12 -0
- data/support/gems/rspec-core-2.11.1/lib/autotest/discover.rb +1 -0
- data/support/gems/rspec-core-2.11.1/lib/autotest/rspec2.rb +73 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/autorun.rb +2 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core.rb +126 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/backward_compatibility.rb +65 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb +36 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb +944 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb +129 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/deprecation.rb +36 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/drb_command_line.rb +26 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/drb_options.rb +87 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/dsl.rb +26 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/example.rb +330 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb +466 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions.rb +4 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions/instance_eval_with_args.rb +44 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions/kernel.rb +9 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions/module_eval_with_args.rb +38 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/extensions/ordered.rb +21 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/filter_manager.rb +203 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/base_formatter.rb +168 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/base_text_formatter.rb +203 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/documentation_formatter.rb +67 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/helpers.rb +39 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/html_formatter.rb +464 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/progress_formatter.rb +32 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/snippet_extractor.rb +58 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/formatters/text_mate_formatter.rb +34 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb +495 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/let.rb +110 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/load_path.rb +3 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/metadata.rb +276 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/metadata_hash_builder.rb +97 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_absolutely_nothing.rb +11 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_flexmock.rb +27 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_mocha.rb +29 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_rr.rb +27 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/mocking/with_rspec.rb +23 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/option_parser.rb +181 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/pending.rb +101 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/project_initializer.rb +87 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/rake_task.rb +179 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb +102 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/ruby_project.rb +44 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb +76 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/shared_context.rb +49 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/shared_example_group.rb +96 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/subject.rb +219 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/version.rb +7 -0
- data/support/gems/rspec-core-2.11.1/lib/rspec/core/world.rb +128 -0
- data/support/gems/rspec-core-2.11.1/spec/autotest/discover_spec.rb +19 -0
- data/support/gems/rspec-core-2.11.1/spec/autotest/failed_results_re_spec.rb +45 -0
- data/support/gems/rspec-core-2.11.1/spec/autotest/rspec_spec.rb +123 -0
- data/support/gems/rspec-core-2.11.1/spec/command_line/order_spec.rb +137 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/command_line_spec.rb +108 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/command_line_spec_output.txt +0 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/configuration_options_spec.rb +377 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/configuration_spec.rb +1196 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/deprecations_spec.rb +66 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/drb_command_line_spec.rb +108 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/drb_options_spec.rb +180 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/dsl_spec.rb +17 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/example_group_spec.rb +1098 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/example_spec.rb +370 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/filter_manager_spec.rb +256 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/base_formatter_spec.rb +80 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/base_text_formatter_spec.rb +363 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/documentation_formatter_spec.rb +88 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/helpers_spec.rb +66 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +410 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatted-1.8.7.html +409 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatted-1.9.2.html +416 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatted-1.9.3.html +416 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/html_formatter_spec.rb +82 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/progress_formatter_spec.rb +30 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/snippet_extractor_spec.rb +18 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +410 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +409 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +416 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatted-1.9.3.html +416 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/formatters/text_mate_formatter_spec.rb +83 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/hooks_filtering_spec.rb +227 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/hooks_spec.rb +250 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/kernel_extensions_spec.rb +9 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/let_spec.rb +55 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/metadata_spec.rb +447 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/option_parser_spec.rb +166 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/pending_example_spec.rb +220 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/project_initializer_spec.rb +130 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/rake_task_spec.rb +138 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/reporter_spec.rb +103 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/a_bar.rb +0 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/a_foo.rb +0 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/a_spec.rb +1 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/custom_example_group_runner.rb +14 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/formatter_specs.rb +60 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/resources/utf8_encoded.rb +8 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/rspec_matchers_spec.rb +45 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/ruby_project_spec.rb +24 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/runner_spec.rb +81 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/shared_context_spec.rb +67 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/shared_example_group_spec.rb +84 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/subject_spec.rb +244 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core/world_spec.rb +144 -0
- data/support/gems/rspec-core-2.11.1/spec/rspec/core_spec.rb +35 -0
- data/support/gems/rspec-core-2.11.1/spec/spec_helper.rb +98 -0
- data/support/gems/rspec-core-2.11.1/spec/support/config_options_helper.rb +24 -0
- data/support/gems/rspec-core-2.11.1/spec/support/helper_methods.rb +5 -0
- data/support/gems/rspec-core-2.11.1/spec/support/matchers.rb +65 -0
- data/support/gems/rspec-core-2.11.1/spec/support/shared_example_groups.rb +41 -0
- data/support/gems/rspec-core-2.11.1/spec/support/spec_files.rb +44 -0
- data/support/gems/rspec-expectations-2.11.2/.document +5 -0
- data/support/gems/rspec-expectations-2.11.2/.yardopts +6 -0
- data/support/gems/rspec-expectations-2.11.2/Changelog.md +246 -0
- data/support/gems/rspec-expectations-2.11.2/License.txt +23 -0
- data/support/gems/rspec-expectations-2.11.2/README.md +224 -0
- data/support/gems/rspec-expectations-2.11.2/features/README.md +49 -0
- data/support/gems/rspec-expectations-2.11.2/features/Upgrade.md +53 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/README.md +90 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/be.feature +173 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/be_within.feature +46 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/cover.feature +45 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/end_with.feature +46 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/equality.feature +145 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/exist.feature +43 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/expect_change.feature +59 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/expect_error.feature +138 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/have.feature +103 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/include.feature +121 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/match.feature +50 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/operators.feature +221 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/predicates.feature +128 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/respond_to.feature +78 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/satisfy.feature +31 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/start_with.feature +46 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/throw_symbol.feature +85 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/types.feature +114 -0
- data/support/gems/rspec-expectations-2.11.2/features/built_in_matchers/yield.feature +146 -0
- data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/access_running_example.feature +53 -0
- data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/define_diffable_matcher.feature +27 -0
- data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/define_matcher.feature +340 -0
- data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/define_matcher_outside_rspec.feature +38 -0
- data/support/gems/rspec-expectations-2.11.2/features/custom_matchers/define_matcher_with_fluent_interface.feature +24 -0
- data/support/gems/rspec-expectations-2.11.2/features/customized_message.feature +22 -0
- data/support/gems/rspec-expectations-2.11.2/features/diffing.feature +85 -0
- data/support/gems/rspec-expectations-2.11.2/features/implicit_docstrings.feature +52 -0
- data/support/gems/rspec-expectations-2.11.2/features/step_definitions/additional_cli_steps.rb +22 -0
- data/support/gems/rspec-expectations-2.11.2/features/support/env.rb +5 -0
- data/support/gems/rspec-expectations-2.11.2/features/syntax_configuration.feature +68 -0
- data/support/gems/rspec-expectations-2.11.2/features/test_frameworks/test_unit.feature +46 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec-expectations.rb +1 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations.rb +47 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/deprecation.rb +38 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/differ.rb +81 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/errors.rb +9 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/expectation_target.rb +58 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/extensions.rb +2 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/extensions/array.rb +9 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/extensions/object.rb +39 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/fail_with.rb +55 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/handler.rb +48 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/syntax.rb +110 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/expectations/version.rb +8 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers.rb +689 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/be_close.rb +9 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in.rb +39 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/base_matcher.rb +68 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/be.rb +185 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/be_instance_of.rb +11 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/be_kind_of.rb +11 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/be_within.rb +45 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/change.rb +132 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/cover.rb +21 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/eq.rb +22 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/eql.rb +23 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/equal.rb +44 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/exist.rb +26 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/has.rb +47 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/have.rb +107 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/include.rb +51 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/match.rb +12 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/match_array.rb +45 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/raise_error.rb +96 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/respond_to.rb +73 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/satisfy.rb +29 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/start_and_end_with.rb +48 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/throw_symbol.rb +93 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/built_in/yield.rb +219 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/compatibility.rb +14 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/configuration.rb +66 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/dsl.rb +24 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/extensions/instance_eval_with_args.rb +39 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/generated_descriptions.rb +36 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/matcher.rb +299 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/method_missing.rb +12 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/operator_matcher.rb +84 -0
- data/support/gems/rspec-expectations-2.11.2/lib/rspec/matchers/pretty.rb +60 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/differ_spec.rb +153 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/expectation_target_spec.rb +65 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/extensions/kernel_spec.rb +67 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/fail_with_spec.rb +70 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/expectations/handler_spec.rb +206 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/base_matcher_spec.rb +60 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_close_spec.rb +22 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_instance_of_spec.rb +36 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_kind_of_spec.rb +33 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_spec.rb +452 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/be_within_spec.rb +76 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/change_spec.rb +522 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/configuration_spec.rb +160 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/cover_spec.rb +65 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/description_generation_spec.rb +176 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/dsl_spec.rb +57 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/eq_spec.rb +50 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/eql_spec.rb +37 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/equal_spec.rb +57 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/exist_spec.rb +104 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/has_spec.rb +113 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/have_spec.rb +458 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/include_spec.rb +363 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/match_array_spec.rb +120 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/match_spec.rb +57 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/matcher_spec.rb +434 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/matchers_spec.rb +31 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/method_missing_spec.rb +24 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/operator_matcher_spec.rb +221 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/raise_error_spec.rb +339 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/respond_to_spec.rb +292 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/satisfy_spec.rb +40 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/start_with_end_with_spec.rb +174 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/throw_symbol_spec.rb +111 -0
- data/support/gems/rspec-expectations-2.11.2/spec/rspec/matchers/yield_spec.rb +374 -0
- data/support/gems/rspec-expectations-2.11.2/spec/spec_helper.rb +27 -0
- data/support/gems/rspec-expectations-2.11.2/spec/support/classes.rb +56 -0
- data/support/gems/rspec-expectations-2.11.2/spec/support/in_sub_process.rb +31 -0
- data/support/gems/rspec-expectations-2.11.2/spec/support/matchers.rb +22 -0
- data/support/gems/rspec-expectations-2.11.2/spec/support/ruby_version.rb +10 -0
- data/support/gems/rspec-mocks-2.11.1/.document +5 -0
- data/support/gems/rspec-mocks-2.11.1/.yardopts +6 -0
- data/support/gems/rspec-mocks-2.11.1/Changelog.md +199 -0
- data/support/gems/rspec-mocks-2.11.1/License.txt +23 -0
- data/support/gems/rspec-mocks-2.11.1/README.md +276 -0
- data/support/gems/rspec-mocks-2.11.1/features/README.md +67 -0
- data/support/gems/rspec-mocks-2.11.1/features/Scope.md +17 -0
- data/support/gems/rspec-mocks-2.11.1/features/Upgrade.md +22 -0
- data/support/gems/rspec-mocks-2.11.1/features/argument_matchers/README.md +27 -0
- data/support/gems/rspec-mocks-2.11.1/features/argument_matchers/explicit.feature +60 -0
- data/support/gems/rspec-mocks-2.11.1/features/argument_matchers/general_matchers.feature +85 -0
- data/support/gems/rspec-mocks-2.11.1/features/argument_matchers/type_matchers.feature +25 -0
- data/support/gems/rspec-mocks-2.11.1/features/message_expectations/README.md +58 -0
- data/support/gems/rspec-mocks-2.11.1/features/message_expectations/any_instance.feature +21 -0
- data/support/gems/rspec-mocks-2.11.1/features/message_expectations/block_local_expectations.feature.pending +55 -0
- data/support/gems/rspec-mocks-2.11.1/features/message_expectations/expect_message.feature +94 -0
- data/support/gems/rspec-mocks-2.11.1/features/message_expectations/receive_counts.feature +209 -0
- data/support/gems/rspec-mocks-2.11.1/features/message_expectations/warn_when_expectation_is_set_on_nil.feature +50 -0
- data/support/gems/rspec-mocks-2.11.1/features/method_stubs/README.md +43 -0
- data/support/gems/rspec-mocks-2.11.1/features/method_stubs/any_instance.feature +133 -0
- data/support/gems/rspec-mocks-2.11.1/features/method_stubs/as_null_object.feature +35 -0
- data/support/gems/rspec-mocks-2.11.1/features/method_stubs/simple_return_value.feature +64 -0
- data/support/gems/rspec-mocks-2.11.1/features/method_stubs/stub_chain.feature +51 -0
- data/support/gems/rspec-mocks-2.11.1/features/method_stubs/stub_implementation.feature +26 -0
- data/support/gems/rspec-mocks-2.11.1/features/method_stubs/to_ary.feature +47 -0
- data/support/gems/rspec-mocks-2.11.1/features/outside_rspec/configuration.feature +82 -0
- data/support/gems/rspec-mocks-2.11.1/features/outside_rspec/standalone.feature +32 -0
- data/support/gems/rspec-mocks-2.11.1/features/step_definitions/additional_cli_steps.rb +4 -0
- data/support/gems/rspec-mocks-2.11.1/features/stubbing_constants/README.md +62 -0
- data/support/gems/rspec-mocks-2.11.1/features/stubbing_constants/stub_defined_constant.feature +79 -0
- data/support/gems/rspec-mocks-2.11.1/features/stubbing_constants/stub_undefined_constant.feature +50 -0
- data/support/gems/rspec-mocks-2.11.1/features/support/env.rb +6 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks.rb +39 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance.rb +81 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/chain.rb +77 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/expectation_chain.rb +57 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/message_chains.rb +60 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/recorder.rb +197 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/stub_chain.rb +37 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/any_instance/stub_chain_chain.rb +25 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/argument_list_matcher.rb +93 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/argument_matchers.rb +238 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/error_generator.rb +114 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/errors.rb +12 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/example_methods.rb +95 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/extensions/instance_exec.rb +34 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/extensions/marshal.rb +23 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/extensions/psych.rb +23 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/framework.rb +20 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/message_expectation.rb +488 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/method_double.rb +196 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/methods.rb +155 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/mock.rb +7 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/order_group.rb +40 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/proxy.rb +190 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/serialization.rb +34 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/space.rb +34 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/standalone.rb +3 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/stub_const.rb +280 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/test_double.rb +103 -0
- data/support/gems/rspec-mocks-2.11.1/lib/rspec/mocks/version.rb +7 -0
- data/support/gems/rspec-mocks-2.11.1/lib/spec/mocks.rb +2 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/and_yield_spec.rb +114 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/any_instance/message_chains_spec.rb +40 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/any_instance_spec.rb +825 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/any_number_of_times_spec.rb +30 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/argument_expectation_spec.rb +34 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/at_least_spec.rb +142 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/at_most_spec.rb +90 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/block_return_value_spec.rb +53 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_10260_spec.rb +8 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_10263_spec.rb +25 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_11545_spec.rb +32 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_496_spec.rb +17 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_600_spec.rb +22 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_7611_spec.rb +16 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_8165_spec.rb +31 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_830_spec.rb +21 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/bug_report_957_spec.rb +22 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/double_spec.rb +12 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/failing_argument_matchers_spec.rb +95 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/hash_excluding_matcher_spec.rb +67 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/hash_including_matcher_spec.rb +90 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/mock_ordering_spec.rb +103 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/mock_space_spec.rb +58 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/mock_spec.rb +730 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/multiple_return_value_spec.rb +119 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/nil_expectation_warning_spec.rb +62 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/null_object_mock_spec.rb +106 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/once_counts_spec.rb +52 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/options_hash_spec.rb +35 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/partial_mock_spec.rb +156 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb +95 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/passing_argument_matchers_spec.rb +142 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/precise_counts_spec.rb +68 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/record_messages_spec.rb +26 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/serialization_spec.rb +111 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stash_spec.rb +27 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stub_chain_spec.rb +149 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stub_const_spec.rb +309 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stub_implementation_spec.rb +68 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stub_spec.rb +238 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/stubbed_message_expectations_spec.rb +47 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/test_double_spec.rb +57 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/to_ary_spec.rb +40 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks/twice_counts_spec.rb +66 -0
- data/support/gems/rspec-mocks-2.11.1/spec/rspec/mocks_spec.rb +51 -0
- data/support/gems/rspec-mocks-2.11.1/spec/spec_helper.rb +15 -0
- data/support/gems/rspec-rails-2.11.0/.document +5 -0
- data/support/gems/rspec-rails-2.11.0/.yardopts +8 -0
- data/support/gems/rspec-rails-2.11.0/Changelog.md +293 -0
- data/support/gems/rspec-rails-2.11.0/License.txt +22 -0
- data/support/gems/rspec-rails-2.11.0/README.md +494 -0
- data/support/gems/rspec-rails-2.11.0/features/Autotest.md +24 -0
- data/support/gems/rspec-rails-2.11.0/features/Generators.md +8 -0
- data/support/gems/rspec-rails-2.11.0/features/GettingStarted.md +84 -0
- data/support/gems/rspec-rails-2.11.0/features/README.md +56 -0
- data/support/gems/rspec-rails-2.11.0/features/RailsVersions.md +4 -0
- data/support/gems/rspec-rails-2.11.0/features/Transactions.md +84 -0
- data/support/gems/rspec-rails-2.11.0/features/Upgrade.md +117 -0
- data/support/gems/rspec-rails-2.11.0/features/controller_specs/Cookies.md +57 -0
- data/support/gems/rspec-rails-2.11.0/features/controller_specs/README.md +45 -0
- data/support/gems/rspec-rails-2.11.0/features/controller_specs/anonymous_controller.feature +330 -0
- data/support/gems/rspec-rails-2.11.0/features/controller_specs/bypass_rescue.feature +75 -0
- data/support/gems/rspec-rails-2.11.0/features/controller_specs/controller_spec.feature +35 -0
- data/support/gems/rspec-rails-2.11.0/features/controller_specs/isolation_from_views.feature +87 -0
- data/support/gems/rspec-rails-2.11.0/features/controller_specs/render_views.feature +114 -0
- data/support/gems/rspec-rails-2.11.0/features/helper_specs/helper_spec.feature +96 -0
- data/support/gems/rspec-rails-2.11.0/features/mailer_specs/url_helpers.feature +38 -0
- data/support/gems/rspec-rails-2.11.0/features/matchers/README.md +18 -0
- data/support/gems/rspec-rails-2.11.0/features/matchers/new_record_matcher.feature +28 -0
- data/support/gems/rspec-rails-2.11.0/features/matchers/redirect_to_matcher.feature +40 -0
- data/support/gems/rspec-rails-2.11.0/features/matchers/relation_match_array.feature +20 -0
- data/support/gems/rspec-rails-2.11.0/features/matchers/render_template_matcher.feature +28 -0
- data/support/gems/rspec-rails-2.11.0/features/mocks/mock_model.feature +147 -0
- data/support/gems/rspec-rails-2.11.0/features/mocks/stub_model.feature +58 -0
- data/support/gems/rspec-rails-2.11.0/features/model_specs/README.md +21 -0
- data/support/gems/rspec-rails-2.11.0/features/model_specs/errors_on.feature +33 -0
- data/support/gems/rspec-rails-2.11.0/features/model_specs/transactional_examples.feature +109 -0
- data/support/gems/rspec-rails-2.11.0/features/request_specs/request_spec.feature +49 -0
- data/support/gems/rspec-rails-2.11.0/features/routing_specs/README.md +17 -0
- data/support/gems/rspec-rails-2.11.0/features/routing_specs/be_routable_matcher.feature +80 -0
- data/support/gems/rspec-rails-2.11.0/features/routing_specs/named_routes.feature +18 -0
- data/support/gems/rspec-rails-2.11.0/features/routing_specs/route_to_matcher.feature +90 -0
- data/support/gems/rspec-rails-2.11.0/features/step_definitions/additional_cli_steps.rb +4 -0
- data/support/gems/rspec-rails-2.11.0/features/step_definitions/model_steps.rb +3 -0
- data/support/gems/rspec-rails-2.11.0/features/support/env.rb +53 -0
- data/support/gems/rspec-rails-2.11.0/features/view_specs/inferred_controller_path.feature +44 -0
- data/support/gems/rspec-rails-2.11.0/features/view_specs/stub_template.feature +51 -0
- data/support/gems/rspec-rails-2.11.0/features/view_specs/view_spec.feature +174 -0
- data/support/gems/rspec-rails-2.11.0/lib/autotest/rails_rspec2.rb +84 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec.rb +25 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/controller/controller_generator.rb +33 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/controller/templates/controller_spec.rb +14 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/controller/templates/view_spec.rb +5 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/helper/helper_generator.rb +15 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/helper/templates/helper_spec.rb +15 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/install/install_generator.rb +24 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/install/templates/.rspec +1 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/install/templates/spec/spec_helper.rb +38 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/integration/integration_generator.rb +27 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/integration/templates/request_spec.rb +15 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/mailer/mailer_generator.rb +20 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/mailer/templates/fixture +3 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/mailer/templates/mailer_spec.rb +23 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/model/model_generator.rb +22 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/model/templates/fixtures.yml +19 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/model/templates/model_spec.rb +5 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/observer/observer_generator.rb +12 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/observer/templates/observer_spec.rb +5 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/scaffold_generator.rb +158 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/controller_spec.rb +166 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/edit_spec.rb +31 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/index_spec.rb +32 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/new_spec.rb +30 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/routing_spec.rb +37 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/scaffold/templates/show_spec.rb +28 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/view/templates/view_spec.rb +5 -0
- data/support/gems/rspec-rails-2.11.0/lib/generators/rspec/view/view_generator.rb +21 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec-rails.rb +14 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails.rb +17 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/adapters.rb +79 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example.rb +38 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/controller_example_group.rb +128 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/helper_example_group.rb +40 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/mailer_example_group.rb +22 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/model_example_group.rb +10 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/rails_example_group.rb +14 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/request_example_group.rb +23 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/routing_example_group.rb +27 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/example/view_example_group.rb +155 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/extensions.rb +1 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/extensions/active_record/base.rb +45 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/fixture_support.rb +40 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers.rb +26 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/be_a_new.rb +76 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/be_new_record.rb +19 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/have_extension.rb +35 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/have_rendered.rb +40 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/redirect_to.rb +37 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/relation_match_array.rb +3 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/matchers/routing_matchers.rb +107 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/mocks.rb +243 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/module_inclusion.rb +29 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/tasks/rspec.rake +56 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/vendor/capybara.rb +29 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/vendor/webrat.rb +33 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/version.rb +7 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/view_assigns.rb +45 -0
- data/support/gems/rspec-rails-2.11.0/lib/rspec/rails/view_rendering.rb +121 -0
- data/support/gems/rspec-rails-2.11.0/spec/autotest/rails_rspec2_spec.rb +36 -0
- data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/controller/controller_generator_spec.rb +86 -0
- data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/helper/helper_generator_spec.rb +30 -0
- data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/install/install_generator_spec.rb +18 -0
- data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/integration/integration_generator_spec.rb +44 -0
- data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/mailer/mailer_generator_spec.rb +48 -0
- data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/model/model_generator_spec.rb +52 -0
- data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/observer/observer_generator_spec.rb +21 -0
- data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/scaffold/scaffold_generator_spec.rb +107 -0
- data/support/gems/rspec-rails-2.11.0/spec/generators/rspec/view/view_generator_spec.rb +41 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/assertion_adapter_spec.rb +28 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/configuration_spec.rb +26 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/deprecations_spec.rb +18 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/controller_example_group_spec.rb +100 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/helper_example_group_spec.rb +64 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/mailer_example_group_spec.rb +21 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/model_example_group_spec.rb +15 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/request_example_group_spec.rb +17 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/routing_example_group_spec.rb +32 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/example/view_example_group_spec.rb +214 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/extensions/active_model/errors_on_spec.rb +23 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/extensions/active_record/records_spec.rb +9 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/fixture_support_spec.rb +17 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/be_a_new_spec.rb +142 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/be_new_record_spec.rb +19 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/be_routable_spec.rb +41 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/errors_on_spec.rb +38 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/have_rendered_spec.rb +93 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/redirect_to_spec.rb +80 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/relation_match_array_spec.rb +20 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/route_to_spec.rb +152 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/mocks/mock_model_spec.rb +379 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/mocks/stub_model_spec.rb +154 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/setup_and_teardown_adapter_spec.rb +32 -0
- data/support/gems/rspec-rails-2.11.0/spec/rspec/rails/view_rendering_spec.rb +111 -0
- data/support/gems/rspec-rails-2.11.0/spec/spec_helper.rb +31 -0
- data/support/gems/rspec-rails-2.11.0/spec/support/ar_classes.rb +42 -0
- data/support/gems/rspec-rails-2.11.0/spec/support/helpers.rb +20 -0
- data/support/gems/rspec-rails-2.11.0/spec/support/matchers.rb +9 -0
- data/support/specifications/rspec-2.11.0.gemspec +39 -0
- data/support/specifications/rspec-core-2.11.1.gemspec +61 -0
- data/support/specifications/rspec-expectations-2.11.2.gemspec +40 -0
- data/support/specifications/rspec-mocks-2.11.1.gemspec +37 -0
- data/support/specifications/rspec-rails-2.11.0.gemspec +55 -0
- metadata +653 -0
@@ -0,0 +1,1196 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'tmpdir'
|
3
|
+
|
4
|
+
# so the stdlib module is available...
|
5
|
+
module Test; module Unit; module Assertions; end; end; end
|
6
|
+
|
7
|
+
module RSpec::Core
|
8
|
+
|
9
|
+
describe Configuration do
|
10
|
+
|
11
|
+
let(:config) { Configuration.new }
|
12
|
+
|
13
|
+
describe "#load_spec_files" do
|
14
|
+
|
15
|
+
it "loads files using load" do
|
16
|
+
config.files_to_run = ["foo.bar", "blah_spec.rb"]
|
17
|
+
config.should_receive(:load).twice
|
18
|
+
config.load_spec_files
|
19
|
+
end
|
20
|
+
|
21
|
+
it "loads each file once, even if duplicated in list" do
|
22
|
+
config.files_to_run = ["a_spec.rb", "a_spec.rb"]
|
23
|
+
config.should_receive(:load).once
|
24
|
+
config.load_spec_files
|
25
|
+
end
|
26
|
+
|
27
|
+
context "with rspec-1 loaded" do
|
28
|
+
before do
|
29
|
+
Object.const_set(:Spec, Module.new)
|
30
|
+
::Spec::const_set(:VERSION, Module.new)
|
31
|
+
::Spec::VERSION::const_set(:MAJOR, 1)
|
32
|
+
end
|
33
|
+
after { Object.__send__(:remove_const, :Spec) }
|
34
|
+
it "raises with a helpful message" do
|
35
|
+
expect {
|
36
|
+
config.load_spec_files
|
37
|
+
}.to raise_error(/rspec-1 has been loaded/)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "#treat_symbols_as_metadata_keys_with_true_values?" do
|
43
|
+
it 'defaults to false' do
|
44
|
+
config.treat_symbols_as_metadata_keys_with_true_values?.should be_false
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'can be set to true' do
|
48
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
49
|
+
config.treat_symbols_as_metadata_keys_with_true_values?.should be_true
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe "#mock_framework" do
|
54
|
+
it "defaults to :rspec" do
|
55
|
+
config.should_receive(:require).with('rspec/core/mocking/with_rspec')
|
56
|
+
config.mock_framework
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "#mock_framework="do
|
61
|
+
it "delegates to mock_with" do
|
62
|
+
config.should_receive(:mock_with).with(:rspec)
|
63
|
+
config.mock_framework = :rspec
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
shared_examples "a configurable framework adapter" do |m|
|
68
|
+
it "yields a config object if the framework_module supports it" do
|
69
|
+
custom_config = Struct.new(:custom_setting).new
|
70
|
+
mod = Module.new
|
71
|
+
mod.stub(:configuration => custom_config)
|
72
|
+
|
73
|
+
config.send m, mod do |mod_config|
|
74
|
+
mod_config.custom_setting = true
|
75
|
+
end
|
76
|
+
|
77
|
+
custom_config.custom_setting.should be_true
|
78
|
+
end
|
79
|
+
|
80
|
+
it "raises if framework module doesn't support configuration" do
|
81
|
+
mod = Module.new
|
82
|
+
|
83
|
+
lambda do
|
84
|
+
config.send m, mod do |mod_config|
|
85
|
+
end
|
86
|
+
end.should raise_error(/must respond to `configuration`/)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "#mock_with" do
|
91
|
+
before { config.stub(:require) }
|
92
|
+
|
93
|
+
it_behaves_like "a configurable framework adapter", :mock_with
|
94
|
+
|
95
|
+
[:rspec, :mocha, :rr, :flexmock].each do |framework|
|
96
|
+
context "with #{framework}" do
|
97
|
+
it "requires the adapter for #{framework}" do
|
98
|
+
config.should_receive(:require).with("rspec/core/mocking/with_#{framework}")
|
99
|
+
config.mock_with framework
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
context "with a module" do
|
105
|
+
it "sets the mock_framework_adapter to that module" do
|
106
|
+
mod = Module.new
|
107
|
+
config.mock_with mod
|
108
|
+
config.mock_framework.should eq(mod)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
it "uses the null adapter when set to any unknown key" do
|
113
|
+
config.should_receive(:require).with('rspec/core/mocking/with_absolutely_nothing')
|
114
|
+
config.mock_with :crazy_new_mocking_framework_ive_not_yet_heard_of
|
115
|
+
end
|
116
|
+
|
117
|
+
context 'when there are already some example groups defined' do
|
118
|
+
it 'raises an error since this setting must be applied before any groups are defined' do
|
119
|
+
RSpec.world.stub(:example_groups).and_return([double.as_null_object])
|
120
|
+
expect {
|
121
|
+
config.mock_with :mocha
|
122
|
+
}.to raise_error(/must be configured before any example groups are defined/)
|
123
|
+
end
|
124
|
+
|
125
|
+
it 'does not raise an error if the default `mock_with :rspec` is re-configured' do
|
126
|
+
config.mock_framework # called by RSpec when configuring the first example group
|
127
|
+
RSpec.world.stub(:example_groups).and_return([double.as_null_object])
|
128
|
+
config.mock_with :rspec
|
129
|
+
end
|
130
|
+
|
131
|
+
it 'does not raise an error if re-setting the same config' do
|
132
|
+
groups = []
|
133
|
+
RSpec.world.stub(:example_groups => groups)
|
134
|
+
config.mock_with :mocha
|
135
|
+
groups << double.as_null_object
|
136
|
+
config.mock_with :mocha
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe "#expectation_framework" do
|
142
|
+
it "defaults to :rspec" do
|
143
|
+
config.should_receive(:require).with('rspec/expectations')
|
144
|
+
config.expectation_frameworks
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe "#expectation_framework=" do
|
149
|
+
it "delegates to expect_with=" do
|
150
|
+
config.should_receive(:expect_with).with(:rspec)
|
151
|
+
config.expectation_framework = :rspec
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
describe "#expect_with" do
|
156
|
+
before { config.stub(:require) }
|
157
|
+
|
158
|
+
it_behaves_like "a configurable framework adapter", :expect_with
|
159
|
+
|
160
|
+
[
|
161
|
+
[:rspec, 'rspec/expectations'],
|
162
|
+
[:stdlib, 'test/unit/assertions']
|
163
|
+
].each do |framework, required_file|
|
164
|
+
context "with #{framework}" do
|
165
|
+
it "requires #{required_file}" do
|
166
|
+
config.should_receive(:require).with(required_file)
|
167
|
+
config.expect_with framework
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
it "supports multiple calls" do
|
173
|
+
config.expect_with :rspec
|
174
|
+
config.expect_with :stdlib
|
175
|
+
config.expectation_frameworks.should eq [RSpec::Matchers, Test::Unit::Assertions]
|
176
|
+
end
|
177
|
+
|
178
|
+
it "raises if block given with multiple args" do
|
179
|
+
lambda do
|
180
|
+
config.expect_with :rspec, :stdlib do |mod_config|
|
181
|
+
end
|
182
|
+
end.should raise_error(/expect_with only accepts/)
|
183
|
+
end
|
184
|
+
|
185
|
+
it "raises ArgumentError if framework is not supported" do
|
186
|
+
expect do
|
187
|
+
config.expect_with :not_supported
|
188
|
+
end.to raise_error(ArgumentError)
|
189
|
+
end
|
190
|
+
|
191
|
+
context 'when there are already some example groups defined' do
|
192
|
+
it 'raises an error since this setting must be applied before any groups are defined' do
|
193
|
+
RSpec.world.stub(:example_groups).and_return([double.as_null_object])
|
194
|
+
expect {
|
195
|
+
config.expect_with :rspec
|
196
|
+
}.to raise_error(/must be configured before any example groups are defined/)
|
197
|
+
end
|
198
|
+
|
199
|
+
it 'does not raise an error if the default `expect_with :rspec` is re-configured' do
|
200
|
+
config.expectation_frameworks # called by RSpec when configuring the first example group
|
201
|
+
RSpec.world.stub(:example_groups).and_return([double.as_null_object])
|
202
|
+
config.expect_with :rspec
|
203
|
+
end
|
204
|
+
|
205
|
+
it 'does not raise an error if re-setting the same config' do
|
206
|
+
groups = []
|
207
|
+
RSpec.world.stub(:example_groups => groups)
|
208
|
+
config.expect_with :stdlib
|
209
|
+
groups << double.as_null_object
|
210
|
+
config.expect_with :stdlib
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
describe "#expecting_with_rspec?" do
|
216
|
+
before { config.stub(:require) }
|
217
|
+
|
218
|
+
it "returns false by default" do
|
219
|
+
config.should_not be_expecting_with_rspec
|
220
|
+
end
|
221
|
+
|
222
|
+
it "returns true when `expect_with :rspec` has been configured" do
|
223
|
+
config.expect_with :rspec
|
224
|
+
config.should be_expecting_with_rspec
|
225
|
+
end
|
226
|
+
|
227
|
+
it "returns true when `expect_with :rspec, :stdlib` has been configured" do
|
228
|
+
config.expect_with :rspec, :stdlib
|
229
|
+
config.should be_expecting_with_rspec
|
230
|
+
end
|
231
|
+
|
232
|
+
it "returns true when `expect_with :stdlib, :rspec` has been configured" do
|
233
|
+
config.expect_with :stdlib, :rspec
|
234
|
+
config.should be_expecting_with_rspec
|
235
|
+
end
|
236
|
+
|
237
|
+
it "returns false when `expect_with :stdlib` has been configured" do
|
238
|
+
config.expect_with :stdlib
|
239
|
+
config.should_not be_expecting_with_rspec
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
describe "#files_to_run" do
|
244
|
+
it "loads files not following pattern if named explicitly" do
|
245
|
+
config.files_or_directories_to_run = "spec/rspec/core/resources/a_bar.rb"
|
246
|
+
config.files_to_run.should eq([ "spec/rspec/core/resources/a_bar.rb"])
|
247
|
+
end
|
248
|
+
|
249
|
+
it "prevents repetition of dir when start of the pattern" do
|
250
|
+
config.pattern = "spec/**/a_spec.rb"
|
251
|
+
config.files_or_directories_to_run = "spec"
|
252
|
+
config.files_to_run.should eq(["spec/rspec/core/resources/a_spec.rb"])
|
253
|
+
end
|
254
|
+
|
255
|
+
it "does not prevent repetition of dir when later of the pattern" do
|
256
|
+
config.pattern = "rspec/**/a_spec.rb"
|
257
|
+
config.files_or_directories_to_run = "spec"
|
258
|
+
config.files_to_run.should eq(["spec/rspec/core/resources/a_spec.rb"])
|
259
|
+
end
|
260
|
+
|
261
|
+
context "with <path>:<line_number>" do
|
262
|
+
it "overrides inclusion filters set on config" do
|
263
|
+
config.filter_run_including :foo => :bar
|
264
|
+
config.files_or_directories_to_run = "path/to/file.rb:37"
|
265
|
+
config.inclusion_filter.size.should eq(1)
|
266
|
+
config.inclusion_filter[:locations].keys.first.should match(/path\/to\/file\.rb$/)
|
267
|
+
config.inclusion_filter[:locations].values.first.should eq([37])
|
268
|
+
end
|
269
|
+
|
270
|
+
it "overrides inclusion filters set before config" do
|
271
|
+
config.force(:inclusion_filter => {:foo => :bar})
|
272
|
+
config.files_or_directories_to_run = "path/to/file.rb:37"
|
273
|
+
config.inclusion_filter.size.should eq(1)
|
274
|
+
config.inclusion_filter[:locations].keys.first.should match(/path\/to\/file\.rb$/)
|
275
|
+
config.inclusion_filter[:locations].values.first.should eq([37])
|
276
|
+
end
|
277
|
+
|
278
|
+
it "clears exclusion filters set on config" do
|
279
|
+
config.exclusion_filter = { :foo => :bar }
|
280
|
+
config.files_or_directories_to_run = "path/to/file.rb:37"
|
281
|
+
config.exclusion_filter.should be_empty,
|
282
|
+
"expected exclusion filter to be empty:\n#{config.exclusion_filter}"
|
283
|
+
end
|
284
|
+
|
285
|
+
it "clears exclusion filters set before config" do
|
286
|
+
config.force(:exclusion_filter => { :foo => :bar })
|
287
|
+
config.files_or_directories_to_run = "path/to/file.rb:37"
|
288
|
+
config.exclusion_filter.should be_empty,
|
289
|
+
"expected exclusion filter to be empty:\n#{config.exclusion_filter}"
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
context "with default pattern" do
|
294
|
+
it "loads files named _spec.rb" do
|
295
|
+
config.files_or_directories_to_run = "spec/rspec/core/resources"
|
296
|
+
config.files_to_run.should eq([ "spec/rspec/core/resources/a_spec.rb"])
|
297
|
+
end
|
298
|
+
|
299
|
+
it "loads files in Windows", :if => RSpec.windows_os? do
|
300
|
+
config.files_or_directories_to_run = "C:\\path\\to\\project\\spec\\sub\\foo_spec.rb"
|
301
|
+
config.files_to_run.should eq([ "C:/path/to/project/spec/sub/foo_spec.rb"])
|
302
|
+
end
|
303
|
+
|
304
|
+
it "loads files in Windows when directory is specified", :if => RSpec.windows_os? do
|
305
|
+
config.files_or_directories_to_run = "spec\\rspec\\core\\resources"
|
306
|
+
config.files_to_run.should eq([ "spec/rspec/core/resources/a_spec.rb"])
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
context "with default default_path" do
|
311
|
+
it "loads files in the default path when run by rspec" do
|
312
|
+
config.stub(:command) { 'rspec' }
|
313
|
+
config.files_or_directories_to_run = []
|
314
|
+
config.files_to_run.should_not be_empty
|
315
|
+
end
|
316
|
+
|
317
|
+
it "does not load files in the default path when run by ruby" do
|
318
|
+
config.stub(:command) { 'ruby' }
|
319
|
+
config.files_or_directories_to_run = []
|
320
|
+
config.files_to_run.should be_empty
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
325
|
+
%w[pattern= filename_pattern=].each do |setter|
|
326
|
+
describe "##{setter}" do
|
327
|
+
context "with single pattern" do
|
328
|
+
before { config.send(setter, "**/*_foo.rb") }
|
329
|
+
it "loads files following pattern" do
|
330
|
+
file = File.expand_path(File.dirname(__FILE__) + "/resources/a_foo.rb")
|
331
|
+
config.files_or_directories_to_run = file
|
332
|
+
config.files_to_run.should include(file)
|
333
|
+
end
|
334
|
+
|
335
|
+
it "loads files in directories following pattern" do
|
336
|
+
dir = File.expand_path(File.dirname(__FILE__) + "/resources")
|
337
|
+
config.files_or_directories_to_run = dir
|
338
|
+
config.files_to_run.should include("#{dir}/a_foo.rb")
|
339
|
+
end
|
340
|
+
|
341
|
+
it "does not load files in directories not following pattern" do
|
342
|
+
dir = File.expand_path(File.dirname(__FILE__) + "/resources")
|
343
|
+
config.files_or_directories_to_run = dir
|
344
|
+
config.files_to_run.should_not include("#{dir}/a_bar.rb")
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
context "with multiple patterns" do
|
349
|
+
it "supports comma separated values" do
|
350
|
+
config.send(setter, "**/*_foo.rb,**/*_bar.rb")
|
351
|
+
dir = File.expand_path(File.dirname(__FILE__) + "/resources")
|
352
|
+
config.files_or_directories_to_run = dir
|
353
|
+
config.files_to_run.should include("#{dir}/a_foo.rb")
|
354
|
+
config.files_to_run.should include("#{dir}/a_bar.rb")
|
355
|
+
end
|
356
|
+
|
357
|
+
it "supports comma separated values with spaces" do
|
358
|
+
config.send(setter, "**/*_foo.rb, **/*_bar.rb")
|
359
|
+
dir = File.expand_path(File.dirname(__FILE__) + "/resources")
|
360
|
+
config.files_or_directories_to_run = dir
|
361
|
+
config.files_to_run.should include("#{dir}/a_foo.rb")
|
362
|
+
config.files_to_run.should include("#{dir}/a_bar.rb")
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
describe "path with line number" do
|
369
|
+
it "assigns the line number as a location filter" do
|
370
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:37"
|
371
|
+
config.filter.should eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37]}})
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
375
|
+
context "with full_description" do
|
376
|
+
it "overrides filters" do
|
377
|
+
config.filter_run :focused => true
|
378
|
+
config.full_description = "foo"
|
379
|
+
config.filter.should_not have_key(:focused)
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
context "with line number" do
|
384
|
+
|
385
|
+
it "assigns the file and line number as a location filter" do
|
386
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:37"
|
387
|
+
config.filter.should eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37]}})
|
388
|
+
end
|
389
|
+
|
390
|
+
it "assigns multiple files with line numbers as location filters" do
|
391
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:37", "other_spec.rb:44"
|
392
|
+
config.filter.should eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37],
|
393
|
+
File.expand_path("other_spec.rb") => [44]}})
|
394
|
+
end
|
395
|
+
|
396
|
+
it "assigns files with multiple line numbers as location filters" do
|
397
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:37", "path/to/a_spec.rb:44"
|
398
|
+
config.filter.should eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37, 44]}})
|
399
|
+
end
|
400
|
+
end
|
401
|
+
|
402
|
+
context "with multiple line numbers" do
|
403
|
+
it "assigns the file and line numbers as a location filter" do
|
404
|
+
config.files_or_directories_to_run = "path/to/a_spec.rb:1:3:5:7"
|
405
|
+
config.filter.should eq({:locations => {File.expand_path("path/to/a_spec.rb") => [1,3,5,7]}})
|
406
|
+
end
|
407
|
+
end
|
408
|
+
|
409
|
+
it "assigns the example name as the filter on description" do
|
410
|
+
config.full_description = "foo"
|
411
|
+
config.filter.should eq({:full_description => /foo/})
|
412
|
+
end
|
413
|
+
|
414
|
+
it "assigns the example names as the filter on description if description is an array" do
|
415
|
+
config.full_description = [ "foo", "bar" ]
|
416
|
+
config.filter.should eq({:full_description => Regexp.union(/foo/, /bar/)})
|
417
|
+
end
|
418
|
+
|
419
|
+
describe "#default_path" do
|
420
|
+
it 'defaults to "spec"' do
|
421
|
+
config.default_path.should eq('spec')
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
describe "#include" do
|
426
|
+
|
427
|
+
module InstanceLevelMethods
|
428
|
+
def you_call_this_a_blt?
|
429
|
+
"egad man, where's the mayo?!?!?"
|
430
|
+
end
|
431
|
+
end
|
432
|
+
|
433
|
+
it_behaves_like "metadata hash builder" do
|
434
|
+
def metadata_hash(*args)
|
435
|
+
config.include(InstanceLevelMethods, *args)
|
436
|
+
config.include_or_extend_modules.last.last
|
437
|
+
end
|
438
|
+
end
|
439
|
+
|
440
|
+
context "with no filter" do
|
441
|
+
it "includes the given module into each example group" do
|
442
|
+
RSpec.configure do |c|
|
443
|
+
c.include(InstanceLevelMethods)
|
444
|
+
end
|
445
|
+
|
446
|
+
group = ExampleGroup.describe('does like, stuff and junk', :magic_key => :include) { }
|
447
|
+
group.should_not respond_to(:you_call_this_a_blt?)
|
448
|
+
group.new.you_call_this_a_blt?.should eq("egad man, where's the mayo?!?!?")
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
452
|
+
context "with a filter" do
|
453
|
+
it "includes the given module into each matching example group" do
|
454
|
+
RSpec.configure do |c|
|
455
|
+
c.include(InstanceLevelMethods, :magic_key => :include)
|
456
|
+
end
|
457
|
+
|
458
|
+
group = ExampleGroup.describe('does like, stuff and junk', :magic_key => :include) { }
|
459
|
+
group.should_not respond_to(:you_call_this_a_blt?)
|
460
|
+
group.new.you_call_this_a_blt?.should eq("egad man, where's the mayo?!?!?")
|
461
|
+
end
|
462
|
+
end
|
463
|
+
|
464
|
+
end
|
465
|
+
|
466
|
+
describe "#extend" do
|
467
|
+
|
468
|
+
module ThatThingISentYou
|
469
|
+
def that_thing
|
470
|
+
end
|
471
|
+
end
|
472
|
+
|
473
|
+
it_behaves_like "metadata hash builder" do
|
474
|
+
def metadata_hash(*args)
|
475
|
+
config.extend(ThatThingISentYou, *args)
|
476
|
+
config.include_or_extend_modules.last.last
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
480
|
+
it "extends the given module into each matching example group" do
|
481
|
+
RSpec.configure do |c|
|
482
|
+
c.extend(ThatThingISentYou, :magic_key => :extend)
|
483
|
+
end
|
484
|
+
|
485
|
+
group = ExampleGroup.describe(ThatThingISentYou, :magic_key => :extend) { }
|
486
|
+
group.should respond_to(:that_thing)
|
487
|
+
end
|
488
|
+
|
489
|
+
end
|
490
|
+
|
491
|
+
describe "#run_all_when_everything_filtered?" do
|
492
|
+
|
493
|
+
it "defaults to false" do
|
494
|
+
config.run_all_when_everything_filtered?.should be_false
|
495
|
+
end
|
496
|
+
|
497
|
+
it "can be queried with question method" do
|
498
|
+
config.run_all_when_everything_filtered = true
|
499
|
+
config.run_all_when_everything_filtered?.should be_true
|
500
|
+
end
|
501
|
+
end
|
502
|
+
|
503
|
+
%w[color color_enabled].each do |color_option|
|
504
|
+
describe "##{color_option}=" do
|
505
|
+
context "given true" do
|
506
|
+
context "with non-tty output and no autotest" do
|
507
|
+
it "does not set color_enabled" do
|
508
|
+
config.output_stream = StringIO.new
|
509
|
+
config.output_stream.stub(:tty?) { false }
|
510
|
+
config.tty = false
|
511
|
+
config.send "#{color_option}=", true
|
512
|
+
config.send(color_option).should be_false
|
513
|
+
end
|
514
|
+
end
|
515
|
+
|
516
|
+
context "with tty output" do
|
517
|
+
it "does not set color_enabled" do
|
518
|
+
config.output_stream = StringIO.new
|
519
|
+
config.output_stream.stub(:tty?) { true }
|
520
|
+
config.tty = false
|
521
|
+
config.send "#{color_option}=", true
|
522
|
+
config.send(color_option).should be_true
|
523
|
+
end
|
524
|
+
end
|
525
|
+
|
526
|
+
context "with tty set" do
|
527
|
+
it "does not set color_enabled" do
|
528
|
+
config.output_stream = StringIO.new
|
529
|
+
config.output_stream.stub(:tty?) { false }
|
530
|
+
config.tty = true
|
531
|
+
config.send "#{color_option}=", true
|
532
|
+
config.send(color_option).should be_true
|
533
|
+
end
|
534
|
+
end
|
535
|
+
|
536
|
+
context "on windows" do
|
537
|
+
before do
|
538
|
+
@original_host = RbConfig::CONFIG['host_os']
|
539
|
+
RbConfig::CONFIG['host_os'] = 'mingw'
|
540
|
+
config.stub(:require)
|
541
|
+
config.stub(:warn)
|
542
|
+
end
|
543
|
+
|
544
|
+
after do
|
545
|
+
RbConfig::CONFIG['host_os'] = @original_host
|
546
|
+
end
|
547
|
+
|
548
|
+
context "with ANSICON available" do
|
549
|
+
before(:all) do
|
550
|
+
@original_ansicon = ENV['ANSICON']
|
551
|
+
ENV['ANSICON'] = 'ANSICON'
|
552
|
+
end
|
553
|
+
|
554
|
+
after(:all) do
|
555
|
+
ENV['ANSICON'] = @original_ansicon
|
556
|
+
end
|
557
|
+
|
558
|
+
it "enables colors" do
|
559
|
+
config.output_stream = StringIO.new
|
560
|
+
config.output_stream.stub(:tty?) { true }
|
561
|
+
config.send "#{color_option}=", true
|
562
|
+
config.send(color_option).should be_true
|
563
|
+
end
|
564
|
+
|
565
|
+
it "leaves output stream intact" do
|
566
|
+
config.output_stream = $stdout
|
567
|
+
config.stub(:require) do |what|
|
568
|
+
config.output_stream = 'foo' if what =~ /Win32/
|
569
|
+
end
|
570
|
+
config.send "#{color_option}=", true
|
571
|
+
config.output_stream.should eq($stdout)
|
572
|
+
end
|
573
|
+
end
|
574
|
+
|
575
|
+
context "with ANSICON NOT available" do
|
576
|
+
it "warns to install ANSICON" do
|
577
|
+
config.stub(:require) { raise LoadError }
|
578
|
+
config.should_receive(:warn).
|
579
|
+
with(/You must use ANSICON/)
|
580
|
+
config.send "#{color_option}=", true
|
581
|
+
end
|
582
|
+
|
583
|
+
it "sets color_enabled to false" do
|
584
|
+
config.stub(:require) { raise LoadError }
|
585
|
+
config.send "#{color_option}=", true
|
586
|
+
config.color_enabled = true
|
587
|
+
config.send(color_option).should be_false
|
588
|
+
end
|
589
|
+
end
|
590
|
+
end
|
591
|
+
end
|
592
|
+
end
|
593
|
+
|
594
|
+
it "prefers incoming cli_args" do
|
595
|
+
config.output_stream = StringIO.new
|
596
|
+
config.output_stream.stub :tty? => true
|
597
|
+
config.force :color => true
|
598
|
+
config.color = false
|
599
|
+
config.color.should be_true
|
600
|
+
end
|
601
|
+
end
|
602
|
+
|
603
|
+
describe '#formatter=' do
|
604
|
+
it "delegates to add_formatter (better API for user-facing configuration)" do
|
605
|
+
config.should_receive(:add_formatter).with('these','options')
|
606
|
+
config.add_formatter('these','options')
|
607
|
+
end
|
608
|
+
end
|
609
|
+
|
610
|
+
describe "#add_formatter" do
|
611
|
+
|
612
|
+
it "adds to the list of formatters" do
|
613
|
+
config.add_formatter :documentation
|
614
|
+
config.formatters.first.should be_an_instance_of(Formatters::DocumentationFormatter)
|
615
|
+
end
|
616
|
+
|
617
|
+
it "finds a formatter by name (w/ Symbol)" do
|
618
|
+
config.add_formatter :documentation
|
619
|
+
config.formatters.first.should be_an_instance_of(Formatters::DocumentationFormatter)
|
620
|
+
end
|
621
|
+
|
622
|
+
it "finds a formatter by name (w/ String)" do
|
623
|
+
config.add_formatter 'documentation'
|
624
|
+
config.formatters.first.should be_an_instance_of(Formatters::DocumentationFormatter)
|
625
|
+
end
|
626
|
+
|
627
|
+
it "finds a formatter by class" do
|
628
|
+
formatter_class = Class.new(Formatters::BaseTextFormatter)
|
629
|
+
config.add_formatter formatter_class
|
630
|
+
config.formatters.first.should be_an_instance_of(formatter_class)
|
631
|
+
end
|
632
|
+
|
633
|
+
it "finds a formatter by class name" do
|
634
|
+
Object.const_set("ACustomFormatter", Class.new(Formatters::BaseFormatter))
|
635
|
+
config.add_formatter "ACustomFormatter"
|
636
|
+
config.formatters.first.should be_an_instance_of(ACustomFormatter)
|
637
|
+
end
|
638
|
+
|
639
|
+
it "finds a formatter by class fully qualified name" do
|
640
|
+
RSpec.const_set("CustomFormatter", Class.new(Formatters::BaseFormatter))
|
641
|
+
config.add_formatter "RSpec::CustomFormatter"
|
642
|
+
config.formatters.first.should be_an_instance_of(RSpec::CustomFormatter)
|
643
|
+
end
|
644
|
+
|
645
|
+
it "requires a formatter file based on its fully qualified name" do
|
646
|
+
config.should_receive(:require).with('rspec/custom_formatter2') do
|
647
|
+
RSpec.const_set("CustomFormatter2", Class.new(Formatters::BaseFormatter))
|
648
|
+
end
|
649
|
+
config.add_formatter "RSpec::CustomFormatter2"
|
650
|
+
config.formatters.first.should be_an_instance_of(RSpec::CustomFormatter2)
|
651
|
+
end
|
652
|
+
|
653
|
+
it "raises NameError if class is unresolvable" do
|
654
|
+
config.should_receive(:require).with('rspec/custom_formatter3')
|
655
|
+
lambda { config.add_formatter "RSpec::CustomFormatter3" }.should raise_error(NameError)
|
656
|
+
end
|
657
|
+
|
658
|
+
it "raises ArgumentError if formatter is unknown" do
|
659
|
+
lambda { config.add_formatter :progresss }.should raise_error(ArgumentError)
|
660
|
+
end
|
661
|
+
|
662
|
+
context "with a 2nd arg defining the output" do
|
663
|
+
it "creates a file at that path and sets it as the output" do
|
664
|
+
path = File.join(Dir.tmpdir, 'output.txt')
|
665
|
+
config.add_formatter('doc', path)
|
666
|
+
config.formatters.first.output.should be_a(File)
|
667
|
+
config.formatters.first.output.path.should eq(path)
|
668
|
+
end
|
669
|
+
end
|
670
|
+
end
|
671
|
+
|
672
|
+
describe "#filter_run_including" do
|
673
|
+
it_behaves_like "metadata hash builder" do
|
674
|
+
def metadata_hash(*args)
|
675
|
+
config.filter_run_including(*args)
|
676
|
+
config.inclusion_filter
|
677
|
+
end
|
678
|
+
end
|
679
|
+
|
680
|
+
it "sets the filter with a hash" do
|
681
|
+
config.filter_run_including :foo => true
|
682
|
+
config.inclusion_filter[:foo].should be(true)
|
683
|
+
end
|
684
|
+
|
685
|
+
it "sets the filter with a symbol" do
|
686
|
+
RSpec.configuration.stub(:treat_symbols_as_metadata_keys_with_true_values? => true)
|
687
|
+
config.filter_run_including :foo
|
688
|
+
config.inclusion_filter[:foo].should be(true)
|
689
|
+
end
|
690
|
+
|
691
|
+
it "merges with existing filters" do
|
692
|
+
config.filter_run_including :foo => true
|
693
|
+
config.filter_run_including :bar => false
|
694
|
+
|
695
|
+
config.inclusion_filter[:foo].should be(true)
|
696
|
+
config.inclusion_filter[:bar].should be(false)
|
697
|
+
end
|
698
|
+
end
|
699
|
+
|
700
|
+
describe "#filter_run_excluding" do
|
701
|
+
it_behaves_like "metadata hash builder" do
|
702
|
+
def metadata_hash(*args)
|
703
|
+
config.filter_run_excluding(*args)
|
704
|
+
config.exclusion_filter
|
705
|
+
end
|
706
|
+
end
|
707
|
+
|
708
|
+
it "sets the filter" do
|
709
|
+
config.filter_run_excluding :foo => true
|
710
|
+
config.exclusion_filter[:foo].should be(true)
|
711
|
+
end
|
712
|
+
|
713
|
+
it "sets the filter using a symbol" do
|
714
|
+
RSpec.configuration.stub(:treat_symbols_as_metadata_keys_with_true_values? => true)
|
715
|
+
config.filter_run_excluding :foo
|
716
|
+
config.exclusion_filter[:foo].should be(true)
|
717
|
+
end
|
718
|
+
|
719
|
+
it "merges with existing filters" do
|
720
|
+
config.filter_run_excluding :foo => true
|
721
|
+
config.filter_run_excluding :bar => false
|
722
|
+
|
723
|
+
config.exclusion_filter[:foo].should be(true)
|
724
|
+
config.exclusion_filter[:bar].should be(false)
|
725
|
+
end
|
726
|
+
end
|
727
|
+
|
728
|
+
describe "#inclusion_filter" do
|
729
|
+
it "returns {} even if set to nil" do
|
730
|
+
config.inclusion_filter = nil
|
731
|
+
config.inclusion_filter.should eq({})
|
732
|
+
end
|
733
|
+
end
|
734
|
+
|
735
|
+
describe "#inclusion_filter=" do
|
736
|
+
it "treats symbols as hash keys with true values when told to" do
|
737
|
+
RSpec.configuration.stub(:treat_symbols_as_metadata_keys_with_true_values? => true)
|
738
|
+
config.inclusion_filter = :foo
|
739
|
+
config.inclusion_filter.should eq({:foo => true})
|
740
|
+
end
|
741
|
+
|
742
|
+
it "overrides any inclusion filters set on the command line or in configuration files" do
|
743
|
+
config.force(:inclusion_filter => { :foo => :bar })
|
744
|
+
config.inclusion_filter = {:want => :this}
|
745
|
+
config.inclusion_filter.should eq({:want => :this})
|
746
|
+
end
|
747
|
+
end
|
748
|
+
|
749
|
+
describe "#exclusion_filter" do
|
750
|
+
it "returns {} even if set to nil" do
|
751
|
+
config.exclusion_filter = nil
|
752
|
+
config.exclusion_filter.should eq({})
|
753
|
+
end
|
754
|
+
|
755
|
+
describe "the default :if filter" do
|
756
|
+
it "does not exclude a spec with { :if => true } metadata" do
|
757
|
+
config.exclusion_filter[:if].call(true).should be_false
|
758
|
+
end
|
759
|
+
|
760
|
+
it "excludes a spec with { :if => false } metadata" do
|
761
|
+
config.exclusion_filter[:if].call(false).should be_true
|
762
|
+
end
|
763
|
+
|
764
|
+
it "excludes a spec with { :if => nil } metadata" do
|
765
|
+
config.exclusion_filter[:if].call(nil).should be_true
|
766
|
+
end
|
767
|
+
end
|
768
|
+
|
769
|
+
describe "the default :unless filter" do
|
770
|
+
it "excludes a spec with { :unless => true } metadata" do
|
771
|
+
config.exclusion_filter[:unless].call(true).should be_true
|
772
|
+
end
|
773
|
+
|
774
|
+
it "does not exclude a spec with { :unless => false } metadata" do
|
775
|
+
config.exclusion_filter[:unless].call(false).should be_false
|
776
|
+
end
|
777
|
+
|
778
|
+
it "does not exclude a spec with { :unless => nil } metadata" do
|
779
|
+
config.exclusion_filter[:unless].call(nil).should be_false
|
780
|
+
end
|
781
|
+
end
|
782
|
+
end
|
783
|
+
|
784
|
+
describe "#exclusion_filter=" do
|
785
|
+
it "treats symbols as hash keys with true values when told to" do
|
786
|
+
RSpec.configuration.stub(:treat_symbols_as_metadata_keys_with_true_values? => true)
|
787
|
+
config.exclusion_filter = :foo
|
788
|
+
config.exclusion_filter.should eq({:foo => true})
|
789
|
+
end
|
790
|
+
|
791
|
+
it "overrides any exclusion filters set on the command line or in configuration files" do
|
792
|
+
config.force(:exclusion_filter => { :foo => :bar })
|
793
|
+
config.exclusion_filter = {:want => :this}
|
794
|
+
config.exclusion_filter.should eq({:want => :this})
|
795
|
+
end
|
796
|
+
end
|
797
|
+
|
798
|
+
describe "line_numbers=" do
|
799
|
+
before { config.filter_manager.stub(:warn) }
|
800
|
+
|
801
|
+
it "sets the line numbers" do
|
802
|
+
config.line_numbers = ['37']
|
803
|
+
config.filter.should eq({:line_numbers => [37]})
|
804
|
+
end
|
805
|
+
|
806
|
+
it "overrides filters" do
|
807
|
+
config.filter_run :focused => true
|
808
|
+
config.line_numbers = ['37']
|
809
|
+
config.filter.should eq({:line_numbers => [37]})
|
810
|
+
end
|
811
|
+
|
812
|
+
it "prevents subsequent filters" do
|
813
|
+
config.line_numbers = ['37']
|
814
|
+
config.filter_run :focused => true
|
815
|
+
config.filter.should eq({:line_numbers => [37]})
|
816
|
+
end
|
817
|
+
end
|
818
|
+
|
819
|
+
describe "#full_backtrace=" do
|
820
|
+
context "given true" do
|
821
|
+
it "clears the backtrace clean patterns" do
|
822
|
+
config.full_backtrace = true
|
823
|
+
config.backtrace_clean_patterns.should eq([])
|
824
|
+
end
|
825
|
+
end
|
826
|
+
|
827
|
+
context "given false" do
|
828
|
+
it "restores backtrace clean patterns" do
|
829
|
+
config.full_backtrace = false
|
830
|
+
config.backtrace_clean_patterns.should eq(RSpec::Core::Configuration::DEFAULT_BACKTRACE_PATTERNS)
|
831
|
+
end
|
832
|
+
end
|
833
|
+
|
834
|
+
it "doesn't impact other instances of config" do
|
835
|
+
config_1 = Configuration.new
|
836
|
+
config_2 = Configuration.new
|
837
|
+
|
838
|
+
config_1.full_backtrace = true
|
839
|
+
config_2.backtrace_clean_patterns.should_not be_empty
|
840
|
+
end
|
841
|
+
end
|
842
|
+
|
843
|
+
describe "#cleaned_from_backtrace? defaults" do
|
844
|
+
it "returns true for rspec files" do
|
845
|
+
config.cleaned_from_backtrace?("lib/rspec/core.rb").
|
846
|
+
should be_true
|
847
|
+
end
|
848
|
+
|
849
|
+
it "returns true for spec_helper" do
|
850
|
+
config.cleaned_from_backtrace?("spec/spec_helper.rb").
|
851
|
+
should be_true
|
852
|
+
end
|
853
|
+
|
854
|
+
it "returns true for java files (for JRuby)" do
|
855
|
+
config.cleaned_from_backtrace?("org/jruby/RubyArray.java:2336").
|
856
|
+
should be_true
|
857
|
+
end
|
858
|
+
end
|
859
|
+
|
860
|
+
describe "#debug=true" do
|
861
|
+
before do
|
862
|
+
if defined?(Debugger)
|
863
|
+
@orig_debugger = Debugger
|
864
|
+
Object.send(:remove_const, :Debugger)
|
865
|
+
else
|
866
|
+
@orig_debugger = nil
|
867
|
+
end
|
868
|
+
Object.const_set("Debugger", debugger)
|
869
|
+
end
|
870
|
+
|
871
|
+
after do
|
872
|
+
Object.send(:remove_const, :Debugger)
|
873
|
+
Object.const_set("Debugger", @orig_debugger) if @orig_debugger
|
874
|
+
end
|
875
|
+
|
876
|
+
let(:debugger) { double('Debugger').as_null_object }
|
877
|
+
|
878
|
+
it "requires 'ruby-debug'" do
|
879
|
+
config.should_receive(:require).with('ruby-debug')
|
880
|
+
config.debug = true
|
881
|
+
end
|
882
|
+
|
883
|
+
it "starts the debugger" do
|
884
|
+
config.stub(:require)
|
885
|
+
debugger.should_receive(:start)
|
886
|
+
config.debug = true
|
887
|
+
end
|
888
|
+
end
|
889
|
+
|
890
|
+
describe "#debug=false" do
|
891
|
+
it "does not require 'ruby-debug'" do
|
892
|
+
config.should_not_receive(:require).with('ruby-debug')
|
893
|
+
config.debug = false
|
894
|
+
end
|
895
|
+
end
|
896
|
+
|
897
|
+
describe "#output=" do
|
898
|
+
it "sets the output" do
|
899
|
+
output = mock("output")
|
900
|
+
config.output = output
|
901
|
+
config.output.should equal(output)
|
902
|
+
end
|
903
|
+
end
|
904
|
+
|
905
|
+
describe "#libs=" do
|
906
|
+
it "adds directories to the LOAD_PATH" do
|
907
|
+
$LOAD_PATH.should_receive(:unshift).with("a/dir")
|
908
|
+
config.libs = ["a/dir"]
|
909
|
+
end
|
910
|
+
end
|
911
|
+
|
912
|
+
describe "#requires=" do
|
913
|
+
it "requires paths" do
|
914
|
+
config.should_receive(:require).with("a/path")
|
915
|
+
config.requires = ["a/path"]
|
916
|
+
end
|
917
|
+
end
|
918
|
+
|
919
|
+
describe "#add_setting" do
|
920
|
+
describe "with no modifiers" do
|
921
|
+
context "with no additional options" do
|
922
|
+
before do
|
923
|
+
config.add_setting :custom_option
|
924
|
+
end
|
925
|
+
|
926
|
+
it "defaults to nil" do
|
927
|
+
config.custom_option.should be_nil
|
928
|
+
end
|
929
|
+
|
930
|
+
it "adds a predicate" do
|
931
|
+
config.custom_option?.should be_false
|
932
|
+
end
|
933
|
+
|
934
|
+
it "can be overridden" do
|
935
|
+
config.custom_option = "a value"
|
936
|
+
config.custom_option.should eq("a value")
|
937
|
+
end
|
938
|
+
end
|
939
|
+
|
940
|
+
context "with :default => 'a value'" do
|
941
|
+
before do
|
942
|
+
config.add_setting :custom_option, :default => 'a value'
|
943
|
+
end
|
944
|
+
|
945
|
+
it "defaults to 'a value'" do
|
946
|
+
config.custom_option.should eq("a value")
|
947
|
+
end
|
948
|
+
|
949
|
+
it "returns true for the predicate" do
|
950
|
+
config.custom_option?.should be_true
|
951
|
+
end
|
952
|
+
|
953
|
+
it "can be overridden with a truthy value" do
|
954
|
+
config.custom_option = "a new value"
|
955
|
+
config.custom_option.should eq("a new value")
|
956
|
+
end
|
957
|
+
|
958
|
+
it "can be overridden with nil" do
|
959
|
+
config.custom_option = nil
|
960
|
+
config.custom_option.should eq(nil)
|
961
|
+
end
|
962
|
+
|
963
|
+
it "can be overridden with false" do
|
964
|
+
config.custom_option = false
|
965
|
+
config.custom_option.should eq(false)
|
966
|
+
end
|
967
|
+
end
|
968
|
+
end
|
969
|
+
|
970
|
+
context "with :alias => " do
|
971
|
+
it "is deprecated" do
|
972
|
+
RSpec::should_receive(:warn).with(/deprecated/)
|
973
|
+
config.add_setting :custom_option
|
974
|
+
config.add_setting :another_custom_option, :alias => :custom_option
|
975
|
+
end
|
976
|
+
end
|
977
|
+
|
978
|
+
context "with :alias_with => " do
|
979
|
+
before do
|
980
|
+
config.add_setting :custom_option, :alias_with => :another_custom_option
|
981
|
+
end
|
982
|
+
|
983
|
+
it "delegates the getter to the other option" do
|
984
|
+
config.another_custom_option = "this value"
|
985
|
+
config.custom_option.should eq("this value")
|
986
|
+
end
|
987
|
+
|
988
|
+
it "delegates the setter to the other option" do
|
989
|
+
config.custom_option = "this value"
|
990
|
+
config.another_custom_option.should eq("this value")
|
991
|
+
end
|
992
|
+
|
993
|
+
it "delegates the predicate to the other option" do
|
994
|
+
config.custom_option = true
|
995
|
+
config.another_custom_option?.should be_true
|
996
|
+
end
|
997
|
+
end
|
998
|
+
end
|
999
|
+
|
1000
|
+
describe "#configure_group" do
|
1001
|
+
it "extends with 'extend'" do
|
1002
|
+
mod = Module.new
|
1003
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1004
|
+
|
1005
|
+
config.extend(mod, :foo => :bar)
|
1006
|
+
config.configure_group(group)
|
1007
|
+
group.should be_a(mod)
|
1008
|
+
end
|
1009
|
+
|
1010
|
+
it "extends with 'module'" do
|
1011
|
+
mod = Module.new
|
1012
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1013
|
+
|
1014
|
+
config.include(mod, :foo => :bar)
|
1015
|
+
config.configure_group(group)
|
1016
|
+
group.included_modules.should include(mod)
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
it "requires only one matching filter" do
|
1020
|
+
mod = Module.new
|
1021
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1022
|
+
|
1023
|
+
config.include(mod, :foo => :bar, :baz => :bam)
|
1024
|
+
config.configure_group(group)
|
1025
|
+
group.included_modules.should include(mod)
|
1026
|
+
end
|
1027
|
+
|
1028
|
+
it "includes each one before deciding whether to include the next" do
|
1029
|
+
mod1 = Module.new do
|
1030
|
+
def self.included(host)
|
1031
|
+
host.metadata[:foo] = :bar
|
1032
|
+
end
|
1033
|
+
end
|
1034
|
+
mod2 = Module.new
|
1035
|
+
|
1036
|
+
group = ExampleGroup.describe("group")
|
1037
|
+
|
1038
|
+
config.include(mod1)
|
1039
|
+
config.include(mod2, :foo => :bar)
|
1040
|
+
config.configure_group(group)
|
1041
|
+
group.included_modules.should include(mod1)
|
1042
|
+
group.included_modules.should include(mod2)
|
1043
|
+
end
|
1044
|
+
|
1045
|
+
module IncludeOrExtendMeOnce
|
1046
|
+
def self.included(host)
|
1047
|
+
raise "included again" if host.instance_methods.include?(:foobar)
|
1048
|
+
host.class_eval { def foobar; end }
|
1049
|
+
end
|
1050
|
+
|
1051
|
+
def self.extended(host)
|
1052
|
+
raise "extended again" if host.respond_to?(:foobar)
|
1053
|
+
def host.foobar; end
|
1054
|
+
end
|
1055
|
+
end
|
1056
|
+
|
1057
|
+
it "doesn't include a module when already included in ancestor" do
|
1058
|
+
config.include(IncludeOrExtendMeOnce, :foo => :bar)
|
1059
|
+
|
1060
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1061
|
+
child = group.describe("child")
|
1062
|
+
|
1063
|
+
config.configure_group(group)
|
1064
|
+
config.configure_group(child)
|
1065
|
+
end
|
1066
|
+
|
1067
|
+
it "doesn't extend when ancestor is already extended with same module" do
|
1068
|
+
config.extend(IncludeOrExtendMeOnce, :foo => :bar)
|
1069
|
+
|
1070
|
+
group = ExampleGroup.describe("group", :foo => :bar)
|
1071
|
+
child = group.describe("child")
|
1072
|
+
|
1073
|
+
config.configure_group(group)
|
1074
|
+
config.configure_group(child)
|
1075
|
+
end
|
1076
|
+
end
|
1077
|
+
|
1078
|
+
describe "#alias_example_to" do
|
1079
|
+
it_behaves_like "metadata hash builder" do
|
1080
|
+
after do
|
1081
|
+
RSpec::Core::ExampleGroup.module_eval do
|
1082
|
+
class << self
|
1083
|
+
undef :my_example_method if method_defined? :my_example_method
|
1084
|
+
end
|
1085
|
+
end
|
1086
|
+
end
|
1087
|
+
def metadata_hash(*args)
|
1088
|
+
config.alias_example_to :my_example_method, *args
|
1089
|
+
group = ExampleGroup.describe("group")
|
1090
|
+
example = group.my_example_method("description")
|
1091
|
+
example.metadata
|
1092
|
+
end
|
1093
|
+
end
|
1094
|
+
end
|
1095
|
+
|
1096
|
+
describe "#reset" do
|
1097
|
+
it "clears the reporter" do
|
1098
|
+
config.reporter.should_not be_nil
|
1099
|
+
config.reset
|
1100
|
+
config.instance_variable_get("@reporter").should be_nil
|
1101
|
+
end
|
1102
|
+
|
1103
|
+
it "clears the formatters" do
|
1104
|
+
config.add_formatter "doc"
|
1105
|
+
config.reset
|
1106
|
+
config.formatters.should be_empty
|
1107
|
+
end
|
1108
|
+
end
|
1109
|
+
|
1110
|
+
describe "#force" do
|
1111
|
+
it "forces order" do
|
1112
|
+
config.force :order => "default"
|
1113
|
+
config.order = "rand"
|
1114
|
+
config.order.should eq("default")
|
1115
|
+
end
|
1116
|
+
|
1117
|
+
it "forces order and seed with :order => 'rand:37'" do
|
1118
|
+
config.force :order => "rand:37"
|
1119
|
+
config.order = "default"
|
1120
|
+
config.order.should eq("rand")
|
1121
|
+
config.seed.should eq(37)
|
1122
|
+
end
|
1123
|
+
|
1124
|
+
it "forces order and seed with :seed => '37'" do
|
1125
|
+
config.force :seed => "37"
|
1126
|
+
config.order = "default"
|
1127
|
+
config.seed.should eq(37)
|
1128
|
+
config.order.should eq("rand")
|
1129
|
+
end
|
1130
|
+
|
1131
|
+
it "forces 'false' value" do
|
1132
|
+
config.add_setting :custom_option
|
1133
|
+
config.custom_option = true
|
1134
|
+
config.custom_option?.should be_true
|
1135
|
+
config.force :custom_option => false
|
1136
|
+
config.custom_option?.should be_false
|
1137
|
+
config.custom_option = true
|
1138
|
+
config.custom_option?.should be_false
|
1139
|
+
end
|
1140
|
+
end
|
1141
|
+
|
1142
|
+
describe '#seed' do
|
1143
|
+
it 'returns the seed as an int' do
|
1144
|
+
config.seed = '123'
|
1145
|
+
config.seed.should eq(123)
|
1146
|
+
end
|
1147
|
+
end
|
1148
|
+
|
1149
|
+
describe '#randomize?' do
|
1150
|
+
context 'with order set to :random' do
|
1151
|
+
before { config.order = :random }
|
1152
|
+
|
1153
|
+
it 'returns true' do
|
1154
|
+
config.randomize?.should be_true
|
1155
|
+
end
|
1156
|
+
end
|
1157
|
+
|
1158
|
+
context 'with order set to nil' do
|
1159
|
+
before { config.order = nil }
|
1160
|
+
|
1161
|
+
it 'returns false' do
|
1162
|
+
config.randomize?.should be_false
|
1163
|
+
end
|
1164
|
+
end
|
1165
|
+
end
|
1166
|
+
|
1167
|
+
describe '#order=' do
|
1168
|
+
context 'given "random:123"' do
|
1169
|
+
before { config.order = 'random:123' }
|
1170
|
+
|
1171
|
+
it 'sets order to "random"' do
|
1172
|
+
config.order.should eq('random')
|
1173
|
+
end
|
1174
|
+
|
1175
|
+
it 'sets seed to 123' do
|
1176
|
+
config.seed.should eq(123)
|
1177
|
+
end
|
1178
|
+
end
|
1179
|
+
|
1180
|
+
context 'given "default"' do
|
1181
|
+
before do
|
1182
|
+
config.order = 'rand:123'
|
1183
|
+
config.order = 'default'
|
1184
|
+
end
|
1185
|
+
|
1186
|
+
it "sets the order to nil" do
|
1187
|
+
config.order.should be_nil
|
1188
|
+
end
|
1189
|
+
|
1190
|
+
it "sets the seed to nil" do
|
1191
|
+
config.seed.should be_nil
|
1192
|
+
end
|
1193
|
+
end
|
1194
|
+
end
|
1195
|
+
end
|
1196
|
+
end
|