rspec 1.2.8 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.rdoc +41 -2
- data/Manifest.txt +11 -10
- data/Rakefile +47 -22
- data/Ruby1.9.rdoc +1 -2
- data/Upgrade.rdoc +56 -7
- data/bin/spec +2 -1
- data/cucumber.yml +3 -1
- data/examples/failing/README.txt +7 -3
- data/examples/failing/failing_implicit_docstrings_example.rb +0 -2
- data/examples/failing/mocking_example.rb +0 -2
- data/examples/failing/partial_mock_example.rb +0 -2
- data/examples/failing/pending_example.rb +0 -2
- data/examples/failing/predicate_example.rb +0 -2
- data/examples/failing/team_spec.rb +0 -3
- data/examples/failing/timeout_behaviour.rb +0 -2
- data/examples/passing/custom_formatter.rb +0 -1
- data/examples/passing/dynamic_spec.rb +0 -2
- data/examples/passing/file_accessor.rb +1 -2
- data/examples/passing/file_accessor_spec.rb +1 -2
- data/examples/passing/filtered_formatter.rb +0 -1
- data/examples/passing/greeter_spec.rb +0 -1
- data/examples/passing/helper_method_example.rb +0 -2
- data/examples/passing/implicit_docstrings_example.rb +0 -2
- data/examples/passing/io_processor_spec.rb +1 -2
- data/examples/passing/mocking_example.rb +0 -2
- data/examples/passing/nested_classes_example.rb +1 -2
- data/examples/passing/options_example.rb +0 -2
- data/examples/passing/partial_mock_example.rb +0 -2
- data/examples/passing/pending_example.rb +0 -2
- data/examples/passing/predicate_example.rb +0 -2
- data/examples/passing/shared_example_group_example.rb +0 -2
- data/examples/passing/simple_matcher_example.rb +0 -2
- data/examples/passing/stack_spec.rb +2 -3
- data/examples/passing/stack_spec_with_nested_example_groups.rb +2 -3
- data/examples/passing/stubbing_example.rb +0 -2
- data/examples/passing/yielding_example.rb +0 -2
- data/features/before_and_after_blocks/before_and_after_blocks.feature +4 -4
- data/features/command_line/line_number_option.feature +14 -14
- data/features/command_line/line_number_option_with_example_with_no_name.feature +2 -2
- data/features/example_groups/define_example_attribute.feature +41 -0
- data/features/example_groups/example_group_with_should_methods.feature +1 -1
- data/features/example_groups/implicit_docstrings.feature +7 -7
- data/features/example_groups/nested_groups.feature +2 -2
- data/features/expectations/customized_message.feature +4 -4
- data/features/expectations/expect_change.feature +4 -4
- data/features/expectations/expect_error.feature +4 -4
- data/features/extensions/custom_example_group.feature +10 -10
- data/features/formatters/custom_formatter.feature +3 -3
- data/features/interop/examples_and_tests_together.feature +10 -6
- data/features/interop/rspec_output.feature +1 -1
- data/features/interop/test_case_with_should_methods.feature +1 -1
- data/features/load_paths/add_lib_to_load_path.feature +20 -0
- data/features/load_paths/add_spec_to_load_path.feature +20 -0
- data/features/matchers/define_diffable_matcher.feature +2 -2
- data/features/matchers/define_matcher.feature +19 -19
- data/features/matchers/define_matcher_outside_rspec.feature +2 -3
- data/features/matchers/define_matcher_with_fluent_interface.feature +2 -2
- data/features/matchers/define_wrapped_matcher.feature +29 -0
- data/features/mock_framework_integration/use_flexmock.feature +1 -1
- data/features/mock_framework_integration/use_mocha.feature +1 -1
- data/features/mock_framework_integration/use_rr.feature +1 -1
- data/features/mocks/mix_stubs_and_mocks.feature +2 -2
- data/features/mocks/stub_implementation.feature +1 -1
- data/features/pending/pending_examples.feature +16 -16
- data/features/runner/specify_line_number.feature +4 -4
- data/features/spec_helper/spec_helper.feature +25 -0
- data/features/step_definitions/running_rspec_steps.rb +4 -2
- data/features/subject/explicit_subject.feature +2 -2
- data/features/subject/implicit_subject.feature +14 -2
- data/features/support/env.rb +6 -3
- data/lib/spec/adapters/mock_frameworks/mocha.rb +6 -1
- data/lib/spec/example/example_group_methods.rb +7 -0
- data/lib/spec/example/example_methods.rb +1 -1
- data/lib/spec/example/subject.rb +8 -0
- data/lib/spec/interop/test.rb +27 -1
- data/lib/spec/interop/test/unit/testcase.rb +1 -1
- data/lib/spec/matchers/exist.rb +2 -2
- data/lib/spec/matchers/extensions/instance_exec.rb +28 -20
- data/lib/spec/matchers/matcher.rb +21 -20
- data/lib/spec/mocks/argument_matchers.rb +17 -13
- data/lib/spec/mocks/error_generator.rb +14 -3
- data/lib/spec/mocks/{spec_methods.rb → example_methods.rb} +25 -11
- data/lib/spec/mocks/framework.rb +1 -1
- data/lib/spec/mocks/methods.rb +15 -0
- data/lib/spec/mocks/mock.rb +16 -10
- data/lib/spec/mocks/proxy.rb +1 -1
- data/lib/spec/rake/spectask.rb +3 -3
- data/lib/spec/runner/backtrace_tweaker.rb +41 -22
- data/lib/spec/runner/configuration.rb +18 -1
- data/lib/spec/runner/differs/default.rb +1 -1
- data/lib/spec/runner/drb_command_line.rb +5 -2
- data/lib/spec/runner/formatter/base_text_formatter.rb +8 -3
- data/lib/spec/runner/option_parser.rb +21 -15
- data/lib/spec/runner/options.rb +54 -23
- data/lib/spec/version.rb +3 -3
- data/resources/helpers/cmdline.rb +0 -1
- data/spec/autotest/autotest_helper.rb +4 -6
- data/spec/autotest/discover_spec.rb +2 -2
- data/spec/autotest/failed_results_re_spec.rb +1 -1
- data/spec/autotest/rspec_spec.rb +1 -1
- data/spec/spec/dsl/main_spec.rb +1 -1
- data/spec/spec/example/example_group_class_definition_spec.rb +1 -1
- data/spec/spec/example/example_group_factory_spec.rb +1 -1
- data/spec/spec/example/example_group_methods_spec.rb +21 -1
- data/spec/spec/example/example_group_proxy_spec.rb +1 -1
- data/spec/spec/example/example_group_spec.rb +1 -1
- data/spec/spec/example/example_matcher_spec.rb +1 -1
- data/spec/spec/example/example_methods_spec.rb +1 -1
- data/spec/spec/example/example_proxy_spec.rb +1 -1
- data/spec/spec/example/helper_method_spec.rb +1 -1
- data/spec/spec/example/nested_example_group_spec.rb +1 -1
- data/spec/spec/example/predicate_matcher_spec.rb +1 -1
- data/spec/spec/example/shared_example_group_spec.rb +1 -1
- data/spec/spec/example/subclassing_example_group_spec.rb +1 -1
- data/spec/spec/example/subject_spec.rb +17 -1
- data/spec/spec/expectations/differs/default_spec.rb +16 -3
- data/spec/spec/expectations/extensions/kernel_spec.rb +1 -1
- data/spec/spec/expectations/fail_with_spec.rb +1 -1
- data/spec/spec/expectations/handler_spec.rb +1 -1
- data/spec/spec/expectations/wrap_expectation_spec.rb +1 -1
- data/spec/spec/interop/test/unit/resources/test_case_with_various_names.rb +22 -0
- data/spec/spec/interop/test/unit/spec_spec.rb +1 -1
- data/spec/spec/interop/test/unit/test_unit_spec_helper.rb +2 -2
- data/spec/spec/interop/test/unit/testcase_spec.rb +7 -2
- data/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +1 -1
- data/spec/spec/matchers/be_close_spec.rb +1 -1
- data/spec/spec/matchers/be_instance_of_spec.rb +1 -1
- data/spec/spec/matchers/be_kind_of_spec.rb +1 -1
- data/spec/spec/matchers/be_spec.rb +13 -1
- data/spec/spec/matchers/change_spec.rb +1 -1
- data/spec/spec/matchers/compatibility_spec.rb +1 -1
- data/spec/spec/matchers/description_generation_spec.rb +1 -1
- data/spec/spec/matchers/dsl_spec.rb +1 -1
- data/spec/spec/matchers/eql_spec.rb +1 -1
- data/spec/spec/matchers/equal_spec.rb +1 -1
- data/spec/spec/matchers/exist_spec.rb +6 -2
- data/spec/spec/matchers/has_spec.rb +19 -1
- data/spec/spec/matchers/have_spec.rb +1 -1
- data/spec/spec/matchers/include_spec.rb +1 -1
- data/spec/spec/matchers/match_array_spec.rb +1 -1
- data/spec/spec/matchers/match_spec.rb +1 -1
- data/spec/spec/matchers/matcher_methods_spec.rb +1 -1
- data/spec/spec/matchers/matcher_spec.rb +55 -28
- data/spec/spec/matchers/matchers_spec.rb +1 -1
- data/spec/spec/matchers/operator_matcher_spec.rb +1 -1
- data/spec/spec/matchers/raise_error_spec.rb +1 -1
- data/spec/spec/matchers/respond_to_spec.rb +1 -1
- data/spec/spec/matchers/satisfy_spec.rb +1 -1
- data/spec/spec/matchers/simple_matcher_spec.rb +1 -1
- data/spec/spec/matchers/throw_symbol_spec.rb +1 -1
- data/spec/spec/mocks/any_number_of_times_spec.rb +1 -1
- data/spec/spec/mocks/argument_expectation_spec.rb +1 -1
- data/spec/spec/mocks/argument_matchers_spec.rb +19 -0
- data/spec/spec/mocks/at_least_spec.rb +1 -1
- data/spec/spec/mocks/at_most_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_10260_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_10263_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_11545_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_15719_spec.rb +3 -3
- data/spec/spec/mocks/bug_report_496_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_600_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_7611_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_7805_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_8165_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_8302_spec.rb +1 -1
- data/spec/spec/mocks/bug_report_830_spec.rb +1 -1
- data/spec/spec/mocks/double_spec.rb +12 -0
- data/spec/spec/mocks/failing_argument_matchers_spec.rb +6 -6
- data/spec/spec/mocks/hash_including_matcher_spec.rb +1 -1
- data/spec/spec/mocks/hash_not_including_matcher_spec.rb +1 -1
- data/spec/spec/mocks/mock_ordering_spec.rb +4 -4
- data/spec/spec/mocks/mock_space_spec.rb +1 -1
- data/spec/spec/mocks/mock_spec.rb +20 -24
- data/spec/spec/mocks/multiple_return_value_spec.rb +8 -8
- data/spec/spec/mocks/nil_expectation_warning_spec.rb +1 -1
- data/spec/spec/mocks/null_object_mock_spec.rb +1 -1
- data/spec/spec/mocks/once_counts_spec.rb +1 -1
- data/spec/spec/mocks/options_hash_spec.rb +1 -1
- data/spec/spec/mocks/partial_mock_spec.rb +1 -1
- data/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +1 -1
- data/spec/spec/mocks/passing_argument_matchers_spec.rb +1 -1
- data/spec/spec/mocks/precise_counts_spec.rb +1 -1
- data/spec/spec/mocks/record_messages_spec.rb +1 -1
- data/spec/spec/mocks/stub_chain_spec.rb +1 -1
- data/spec/spec/mocks/stub_implementation_spec.rb +1 -1
- data/spec/spec/mocks/stub_spec.rb +14 -9
- data/spec/spec/mocks/stubbed_message_expectations_spec.rb +2 -2
- data/spec/spec/mocks/twice_counts_spec.rb +1 -1
- data/spec/spec/mocks/unstub_spec.rb +1 -1
- data/spec/spec/package/bin_spec_spec.rb +4 -10
- data/spec/spec/rake/spectask_spec.rb +2 -2
- data/spec/spec/runner/class_and_argument_parser_spec.rb +1 -1
- data/spec/spec/runner/command_line_spec.rb +1 -1
- data/spec/spec/runner/configuration_spec.rb +15 -6
- data/spec/spec/runner/drb_command_line_spec.rb +1 -1
- data/spec/spec/runner/example_group_runner_spec.rb +1 -1
- data/spec/spec/runner/formatter/base_formatter_spec.rb +1 -1
- data/spec/spec/runner/formatter/base_text_formatter_spec.rb +10 -1
- data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +1 -1
- data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +1 -1
- data/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +72 -76
- data/spec/spec/runner/formatter/html_formatted-1.8.6.html +50 -50
- data/spec/spec/runner/formatter/html_formatted-1.8.7.html +50 -50
- data/spec/spec/runner/formatter/html_formatted-1.9.1.html +61 -69
- data/spec/spec/runner/formatter/html_formatter_spec.rb +26 -26
- data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +1 -1
- data/spec/spec/runner/formatter/profile_formatter_spec.rb +1 -1
- data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +13 -9
- data/spec/spec/runner/formatter/snippet_extractor_spec.rb +1 -1
- data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +1 -1
- data/spec/spec/runner/formatter/{text_mate_formatted-1.8.4.html → text_mate_formatted-1.8.6-jruby.html} +64 -59
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +46 -46
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.7.html +46 -46
- data/spec/spec/runner/formatter/text_mate_formatted-1.9.1.html +55 -63
- data/spec/spec/runner/formatter/text_mate_formatter_spec.rb +3 -3
- data/spec/spec/runner/heckle_runner_spec.rb +1 -1
- data/spec/spec/runner/heckler_spec.rb +1 -1
- data/spec/spec/runner/line_number_query/line_number_query_fixture.rb +1 -1
- data/spec/spec/runner/line_number_query_spec.rb +10 -1
- data/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +22 -16
- data/spec/spec/runner/option_parser_spec.rb +48 -14
- data/spec/spec/runner/options_spec.rb +16 -2
- data/spec/spec/runner/output_one_time_fixture.rb +1 -1
- data/spec/spec/runner/output_one_time_fixture_runner.rb +2 -3
- data/spec/spec/runner/output_one_time_spec.rb +6 -7
- data/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +65 -22
- data/spec/spec/runner/reporter_spec.rb +1 -1
- data/spec/spec/runner_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -7
- data/spec/{spec → support}/spec_classes.rb +0 -0
- metadata +58 -17
- data/examples/failing/spec_helper.rb +0 -3
- data/examples/passing/spec_helper.rb +0 -3
- data/features/heckle/heckle.feature +0 -56
- data/spec/rspec_suite.rb +0 -6
- data/spec/spec/runner/formatter/html_formatted-1.8.4.html +0 -366
- data/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +0 -387
- data/spec/spec/runner/formatter/html_formatted-1.8.5.html +0 -372
data/History.rdoc
CHANGED
|
@@ -1,4 +1,43 @@
|
|
|
1
|
-
=== Version 1.2.
|
|
1
|
+
=== Version 1.2.9 / 2009-10-05
|
|
2
|
+
|
|
3
|
+
* enhancements
|
|
4
|
+
* manage backtrace-ignore patterns with Spec::Runner.configure (Martin
|
|
5
|
+
Emde). Closes #870.
|
|
6
|
+
* friendly mock argument expectation failure message (Tim Harper). Closes
|
|
7
|
+
#868.
|
|
8
|
+
* added double() as alias for stub() and mock()
|
|
9
|
+
* failure messages for doubles, mocks and stubs use the right name
|
|
10
|
+
* add let() method to assign memoized attributes (suggestion from Stuart
|
|
11
|
+
Halloway). Closes #857.
|
|
12
|
+
* add its method so you can say:
|
|
13
|
+
describe Array do
|
|
14
|
+
its(:length) { should == 0 }
|
|
15
|
+
(Stephen Touset). Closes #833
|
|
16
|
+
* spec command automatically uses spec/spec.opts if it is present
|
|
17
|
+
(suggestion from Yehuda Katz)
|
|
18
|
+
* rspec now adds PROJECT_ROOT/lib and PROJECT_ROOT/spec to the load path
|
|
19
|
+
* determines PROJECT_ROOT by recursing up until it finds a directory
|
|
20
|
+
that has a ./spec directory (thanks to Scott Taylor)
|
|
21
|
+
* supports require 'spec_helper'
|
|
22
|
+
* supports running specs from the PROJECT_ROOT or any directory
|
|
23
|
+
below it
|
|
24
|
+
* closes #733
|
|
25
|
+
* better handling of determining test names in test/unit/interop mode
|
|
26
|
+
* Joe Ferris
|
|
27
|
+
* closes #854
|
|
28
|
+
|
|
29
|
+
* bug fixes
|
|
30
|
+
|
|
31
|
+
* Fixed problem with colorized output when writing to a file
|
|
32
|
+
* Corey Ehmke
|
|
33
|
+
* closes #777
|
|
34
|
+
|
|
35
|
+
* not really a bug fix or enhancement
|
|
36
|
+
* temporarily moved heckle feature to features-pending (waiting to see what
|
|
37
|
+
happens with
|
|
38
|
+
http://rubyforge.org/tracker/index.php?func=detail&aid=26786&group_id=1513&atid=5921)
|
|
39
|
+
|
|
40
|
+
=== Version 1.2.8 / 2009-07-16
|
|
2
41
|
|
|
3
42
|
* enhancements
|
|
4
43
|
* better messages for should[_not] be_nil (Chad Humphries and Rob Sanheim)
|
|
@@ -56,7 +95,7 @@
|
|
|
56
95
|
* add stub_chain method
|
|
57
96
|
* also alias_method :stub, :stub!, so you can stub with less bang
|
|
58
97
|
* added options to example_group_proxy
|
|
59
|
-
|
|
98
|
+
|
|
60
99
|
* bug fixes
|
|
61
100
|
|
|
62
101
|
* ensure correct handling of ordered message expectations with duplicate
|
data/Manifest.txt
CHANGED
|
@@ -23,7 +23,6 @@ examples/failing/partial_mock_example.rb
|
|
|
23
23
|
examples/failing/pending_example.rb
|
|
24
24
|
examples/failing/predicate_example.rb
|
|
25
25
|
examples/failing/raising_example.rb
|
|
26
|
-
examples/failing/spec_helper.rb
|
|
27
26
|
examples/failing/syntax_error_example.rb
|
|
28
27
|
examples/failing/team_spec.rb
|
|
29
28
|
examples/failing/timeout_behaviour.rb
|
|
@@ -50,7 +49,6 @@ examples/passing/predicate_example.rb
|
|
|
50
49
|
examples/passing/shared_example_group_example.rb
|
|
51
50
|
examples/passing/shared_stack_examples.rb
|
|
52
51
|
examples/passing/simple_matcher_example.rb
|
|
53
|
-
examples/passing/spec_helper.rb
|
|
54
52
|
examples/passing/stack.rb
|
|
55
53
|
examples/passing/stack_spec.rb
|
|
56
54
|
examples/passing/stack_spec_with_nested_example_groups.rb
|
|
@@ -60,6 +58,7 @@ examples/ruby1.9.compatibility/access_to_constants_spec.rb
|
|
|
60
58
|
features/before_and_after_blocks/before_and_after_blocks.feature
|
|
61
59
|
features/command_line/line_number_option.feature
|
|
62
60
|
features/command_line/line_number_option_with_example_with_no_name.feature
|
|
61
|
+
features/example_groups/define_example_attribute.feature
|
|
63
62
|
features/example_groups/example_group_with_should_methods.feature
|
|
64
63
|
features/example_groups/implicit_docstrings.feature
|
|
65
64
|
features/example_groups/nested_groups.feature
|
|
@@ -68,15 +67,17 @@ features/expectations/expect_change.feature
|
|
|
68
67
|
features/expectations/expect_error.feature
|
|
69
68
|
features/extensions/custom_example_group.feature
|
|
70
69
|
features/formatters/custom_formatter.feature
|
|
71
|
-
features/heckle/heckle.feature
|
|
72
70
|
features/interop/examples_and_tests_together.feature
|
|
73
71
|
features/interop/rspec_output.feature
|
|
74
72
|
features/interop/test_but_not_test_unit.feature
|
|
75
73
|
features/interop/test_case_with_should_methods.feature
|
|
74
|
+
features/load_paths/add_lib_to_load_path.feature
|
|
75
|
+
features/load_paths/add_spec_to_load_path.feature
|
|
76
76
|
features/matchers/define_diffable_matcher.feature
|
|
77
77
|
features/matchers/define_matcher.feature
|
|
78
78
|
features/matchers/define_matcher_outside_rspec.feature
|
|
79
79
|
features/matchers/define_matcher_with_fluent_interface.feature
|
|
80
|
+
features/matchers/define_wrapped_matcher.feature
|
|
80
81
|
features/mock_framework_integration/use_flexmock.feature
|
|
81
82
|
features/mock_framework_integration/use_mocha.feature
|
|
82
83
|
features/mock_framework_integration/use_rr.feature
|
|
@@ -84,6 +85,7 @@ features/mocks/mix_stubs_and_mocks.feature
|
|
|
84
85
|
features/mocks/stub_implementation.feature
|
|
85
86
|
features/pending/pending_examples.feature
|
|
86
87
|
features/runner/specify_line_number.feature
|
|
88
|
+
features/spec_helper/spec_helper.feature
|
|
87
89
|
features/step_definitions/running_rspec_steps.rb
|
|
88
90
|
features/subject/explicit_subject.feature
|
|
89
91
|
features/subject/implicit_subject.feature
|
|
@@ -164,6 +166,7 @@ lib/spec/mocks/argument_expectation.rb
|
|
|
164
166
|
lib/spec/mocks/argument_matchers.rb
|
|
165
167
|
lib/spec/mocks/error_generator.rb
|
|
166
168
|
lib/spec/mocks/errors.rb
|
|
169
|
+
lib/spec/mocks/example_methods.rb
|
|
167
170
|
lib/spec/mocks/extensions.rb
|
|
168
171
|
lib/spec/mocks/extensions/object.rb
|
|
169
172
|
lib/spec/mocks/framework.rb
|
|
@@ -173,7 +176,6 @@ lib/spec/mocks/mock.rb
|
|
|
173
176
|
lib/spec/mocks/order_group.rb
|
|
174
177
|
lib/spec/mocks/proxy.rb
|
|
175
178
|
lib/spec/mocks/space.rb
|
|
176
|
-
lib/spec/mocks/spec_methods.rb
|
|
177
179
|
lib/spec/rake/spectask.rb
|
|
178
180
|
lib/spec/rake/verify_rcov.rb
|
|
179
181
|
lib/spec/ruby.rb
|
|
@@ -220,7 +222,6 @@ spec/autotest/autotest_matchers.rb
|
|
|
220
222
|
spec/autotest/discover_spec.rb
|
|
221
223
|
spec/autotest/failed_results_re_spec.rb
|
|
222
224
|
spec/autotest/rspec_spec.rb
|
|
223
|
-
spec/rspec_suite.rb
|
|
224
225
|
spec/ruby_forker.rb
|
|
225
226
|
spec/spec.opts
|
|
226
227
|
spec/spec/dsl/main_spec.rb
|
|
@@ -251,6 +252,7 @@ spec/spec/interop/test/unit/resources/spec_with_options_hash.rb
|
|
|
251
252
|
spec/spec/interop/test/unit/resources/test_case_that_fails.rb
|
|
252
253
|
spec/spec/interop/test/unit/resources/test_case_that_passes.rb
|
|
253
254
|
spec/spec/interop/test/unit/resources/test_case_with_errors.rb
|
|
255
|
+
spec/spec/interop/test/unit/resources/test_case_with_various_names.rb
|
|
254
256
|
spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb
|
|
255
257
|
spec/spec/interop/test/unit/spec_spec.rb
|
|
256
258
|
spec/spec/interop/test/unit/test_unit_spec_helper.rb
|
|
@@ -283,6 +285,7 @@ spec/spec/matchers/simple_matcher_spec.rb
|
|
|
283
285
|
spec/spec/matchers/throw_symbol_spec.rb
|
|
284
286
|
spec/spec/mocks/any_number_of_times_spec.rb
|
|
285
287
|
spec/spec/mocks/argument_expectation_spec.rb
|
|
288
|
+
spec/spec/mocks/argument_matchers_spec.rb
|
|
286
289
|
spec/spec/mocks/at_least_spec.rb
|
|
287
290
|
spec/spec/mocks/at_most_spec.rb
|
|
288
291
|
spec/spec/mocks/bug_report_10260_spec.rb
|
|
@@ -296,6 +299,7 @@ spec/spec/mocks/bug_report_7805_spec.rb
|
|
|
296
299
|
spec/spec/mocks/bug_report_8165_spec.rb
|
|
297
300
|
spec/spec/mocks/bug_report_8302_spec.rb
|
|
298
301
|
spec/spec/mocks/bug_report_830_spec.rb
|
|
302
|
+
spec/spec/mocks/double_spec.rb
|
|
299
303
|
spec/spec/mocks/failing_argument_matchers_spec.rb
|
|
300
304
|
spec/spec/mocks/hash_including_matcher_spec.rb
|
|
301
305
|
spec/spec/mocks/hash_not_including_matcher_spec.rb
|
|
@@ -332,9 +336,6 @@ spec/spec/runner/formatter/base_formatter_spec.rb
|
|
|
332
336
|
spec/spec/runner/formatter/base_text_formatter_spec.rb
|
|
333
337
|
spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb
|
|
334
338
|
spec/spec/runner/formatter/failing_examples_formatter_spec.rb
|
|
335
|
-
spec/spec/runner/formatter/html_formatted-1.8.4.html
|
|
336
|
-
spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html
|
|
337
|
-
spec/spec/runner/formatter/html_formatted-1.8.5.html
|
|
338
339
|
spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html
|
|
339
340
|
spec/spec/runner/formatter/html_formatted-1.8.6.html
|
|
340
341
|
spec/spec/runner/formatter/html_formatted-1.8.7.html
|
|
@@ -345,7 +346,7 @@ spec/spec/runner/formatter/profile_formatter_spec.rb
|
|
|
345
346
|
spec/spec/runner/formatter/progress_bar_formatter_spec.rb
|
|
346
347
|
spec/spec/runner/formatter/snippet_extractor_spec.rb
|
|
347
348
|
spec/spec/runner/formatter/specdoc_formatter_spec.rb
|
|
348
|
-
spec/spec/runner/formatter/text_mate_formatted-1.8.
|
|
349
|
+
spec/spec/runner/formatter/text_mate_formatted-1.8.6-jruby.html
|
|
349
350
|
spec/spec/runner/formatter/text_mate_formatted-1.8.6.html
|
|
350
351
|
spec/spec/runner/formatter/text_mate_formatted-1.8.7.html
|
|
351
352
|
spec/spec/runner/formatter/text_mate_formatted-1.9.1.html
|
|
@@ -371,6 +372,6 @@ spec/spec/runner/spec.opts
|
|
|
371
372
|
spec/spec/runner/spec_drb.opts
|
|
372
373
|
spec/spec/runner/spec_spaced.opts
|
|
373
374
|
spec/spec/runner_spec.rb
|
|
374
|
-
spec/spec/spec_classes.rb
|
|
375
375
|
spec/spec_helper.rb
|
|
376
376
|
spec/support/macros.rb
|
|
377
|
+
spec/support/spec_classes.rb
|
data/Rakefile
CHANGED
|
@@ -2,24 +2,26 @@
|
|
|
2
2
|
gem 'hoe', '>=2.0.0'
|
|
3
3
|
require 'hoe'
|
|
4
4
|
|
|
5
|
-
$:.unshift
|
|
5
|
+
$:.unshift 'lib'
|
|
6
6
|
|
|
7
7
|
require 'spec/version'
|
|
8
8
|
require 'spec/rake/spectask'
|
|
9
|
+
require 'spec/ruby'
|
|
9
10
|
require 'cucumber/rake/task'
|
|
10
11
|
|
|
11
|
-
Hoe.spec
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
Hoe.spec 'rspec' do
|
|
13
|
+
self.version = Spec::VERSION::STRING
|
|
14
|
+
self.summary = Spec::VERSION::SUMMARY
|
|
15
|
+
self.description = "Behaviour Driven Development for Ruby."
|
|
16
|
+
self.rubyforge_name = 'rspec'
|
|
17
|
+
self.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
|
|
18
|
+
self.extra_dev_deps << ["cucumber",">=0.3"] << ["bmabey-fakefs",">=0.1.1"] << ["syntax",">=1.0"] << ["diff-lcs",">=1.1.2"]
|
|
19
|
+
self.extra_dev_deps << ["heckle",">=1.4.3"] unless Spec::Ruby.version >= "1.9"
|
|
20
|
+
self.remote_rdoc_dir = "rspec/#{Spec::VERSION::STRING}"
|
|
21
|
+
self.rspec_options = ['--options', 'spec/spec.opts']
|
|
22
|
+
self.history_file = 'History.rdoc'
|
|
23
|
+
self.readme_file = 'README.rdoc'
|
|
24
|
+
self.post_install_message = <<-POST_INSTALL_MESSAGE
|
|
23
25
|
#{'*'*50}
|
|
24
26
|
|
|
25
27
|
Thank you for installing rspec-#{Spec::VERSION::STRING}
|
|
@@ -40,31 +42,54 @@ task :post_blog do
|
|
|
40
42
|
end
|
|
41
43
|
|
|
42
44
|
# Some of the tasks are in separate files since they are also part of the website documentation
|
|
43
|
-
load
|
|
44
|
-
load
|
|
45
|
-
load
|
|
46
|
-
load
|
|
45
|
+
load 'resources/rake/examples.rake'
|
|
46
|
+
load 'resources/rake/examples_with_rcov.rake'
|
|
47
|
+
load 'resources/rake/failing_examples_with_html.rake'
|
|
48
|
+
load 'resources/rake/verify_rcov.rake'
|
|
49
|
+
|
|
50
|
+
task :cleanup_rcov_files do
|
|
51
|
+
rm_rf 'coverage.data'
|
|
52
|
+
end
|
|
53
|
+
|
|
47
54
|
|
|
48
55
|
if RUBY_VERSION =~ /^1.8/
|
|
49
|
-
task :default => [:
|
|
56
|
+
task :default => [:cleanup_rcov_files, :features, :verify_rcov]
|
|
50
57
|
else
|
|
51
58
|
task :default => [:spec, :features]
|
|
52
59
|
end
|
|
53
60
|
|
|
54
61
|
namespace :spec do
|
|
62
|
+
|
|
55
63
|
desc "Run all specs with rcov"
|
|
56
|
-
Spec::Rake::SpecTask.new(
|
|
64
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
|
57
65
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
|
58
66
|
t.spec_opts = ['--options', 'spec/spec.opts']
|
|
59
67
|
t.rcov = true
|
|
60
68
|
t.rcov_dir = 'coverage'
|
|
61
|
-
t.rcov_opts = ['--exclude', "kernel,load-diff-lcs\.rb,instance_exec\.rb,lib/spec.rb,lib/spec/runner.rb,^spec/*,bin/spec,examples,/gems,/Library/Ruby,\.autotest,#{ENV['GEM_HOME']}"]
|
|
69
|
+
t.rcov_opts = ['--exclude', "features,kernel,load-diff-lcs\.rb,instance_exec\.rb,lib/spec.rb,lib/spec/runner.rb,^spec/*,bin/spec,examples,/gems,/Library/Ruby,\.autotest,#{ENV['GEM_HOME']}"]
|
|
70
|
+
t.rcov_opts << '--sort coverage --text-summary --aggregate coverage.data'
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
desc "Run files listed in spec/spec_files.txt"
|
|
74
|
+
Spec::Rake::SpecTask.new(:focus) do |t|
|
|
75
|
+
if File.exists?('spec/spec_files.txt')
|
|
76
|
+
t.spec_files = File.readlines('spec/spec_files.txt').collect{|f| f.chomp}
|
|
77
|
+
end
|
|
62
78
|
end
|
|
63
79
|
end
|
|
64
80
|
|
|
65
81
|
desc "Run Cucumber features"
|
|
66
|
-
|
|
67
|
-
|
|
82
|
+
if RUBY_VERSION =~ /^1.8/
|
|
83
|
+
Cucumber::Rake::Task.new :features do |t|
|
|
84
|
+
t.rcov = true
|
|
85
|
+
t.rcov_opts = ['--exclude', "features,kernel,load-diff-lcs\.rb,instance_exec\.rb,lib/spec.rb,lib/spec/runner.rb,^spec/*,bin/spec,examples,/gems,/Library/Ruby,\.autotest,#{ENV['GEM_HOME']}"]
|
|
86
|
+
t.rcov_opts << '--no-html --aggregate coverage.data'
|
|
87
|
+
t.cucumber_opts = %w{--format progress}
|
|
88
|
+
end
|
|
89
|
+
else
|
|
90
|
+
task :features do
|
|
91
|
+
sh 'cucumber --profile no_heckle'
|
|
92
|
+
end
|
|
68
93
|
end
|
|
69
94
|
|
|
70
95
|
desc "Run failing examples (see failure output)"
|
data/Ruby1.9.rdoc
CHANGED
data/Upgrade.rdoc
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
+
= Upgrade to rspec-1.2.9
|
|
2
|
+
|
|
3
|
+
== What's new
|
|
4
|
+
|
|
5
|
+
=== spec/spec.opts
|
|
6
|
+
|
|
7
|
+
If you have a spec/spec.opts file, the spec command will now use that
|
|
8
|
+
automatically as long as you don't include any options on the command line.
|
|
9
|
+
|
|
10
|
+
=== let()
|
|
11
|
+
|
|
12
|
+
Writing specs tends to follow a regular pattern of using local variables, discovering duplication, and then having to convert to local variables to instance variables by adding an "@" symbol. The let() method assigns the result of a lazy eval'd block as the return value of an instance method using
|
|
13
|
+
the same name. This way you can go from this:
|
|
14
|
+
|
|
15
|
+
describe Subscription do
|
|
16
|
+
it "does something" do
|
|
17
|
+
subscription = Subscription.create :limit => 1
|
|
18
|
+
subscription...
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "does something else" do
|
|
22
|
+
subscription = Subscription.create :limit => 1
|
|
23
|
+
subscription...
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
to this:
|
|
28
|
+
|
|
29
|
+
describe Subscription do
|
|
30
|
+
let(:subscription) { Subscription.create :limit => 1 }
|
|
31
|
+
|
|
32
|
+
it "does something" do
|
|
33
|
+
subscription...
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it "does something else" do
|
|
37
|
+
subscription...
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
=== its()
|
|
42
|
+
|
|
43
|
+
If you're in the habit of writing one-liners using implicit subject, this new
|
|
44
|
+
its() feature is for you. Here's the basic idea:
|
|
45
|
+
|
|
46
|
+
describe Array do
|
|
47
|
+
its(:length) { should == 0 }
|
|
48
|
+
end
|
|
49
|
+
|
|
1
50
|
= Upgrade to rspec-1.2.3-1.2.7
|
|
2
51
|
|
|
3
52
|
== What's Changed
|
|
@@ -17,11 +66,11 @@ If you're not familiar with this feature, don't worry about it. If you have anyt
|
|
|
17
66
|
that looks like this:
|
|
18
67
|
|
|
19
68
|
predicate_matchers[:swim] = :can_swim?
|
|
20
|
-
|
|
69
|
+
|
|
21
70
|
Or this
|
|
22
71
|
|
|
23
72
|
config.predicate_matchers[:swim] = :can_swim?
|
|
24
|
-
|
|
73
|
+
|
|
25
74
|
Change it to this:
|
|
26
75
|
|
|
27
76
|
Spec::Matchers.define :swim do
|
|
@@ -63,12 +112,12 @@ information.
|
|
|
63
112
|
|
|
64
113
|
We'll be separating this out to its own gem for rspec 2.0, but for now, just install
|
|
65
114
|
rspec >= 1.2.1 and add the following to your <tt>test_helper</tt> file:
|
|
66
|
-
|
|
115
|
+
|
|
67
116
|
require 'spec/expectations'
|
|
68
117
|
class Test::Unit::TestCase
|
|
69
118
|
include Spec::Matchers
|
|
70
119
|
end
|
|
71
|
-
|
|
120
|
+
|
|
72
121
|
This will add <tt>should()</tt> and <tt>should_not()</tt> to your objects, make all of
|
|
73
122
|
rspec's built-in matchers available to your tests, INCLUDING rspec's DSL for
|
|
74
123
|
creating matchers (see below, under Upgrade to rspec-1.2.0)
|
|
@@ -81,11 +130,11 @@ in your code:
|
|
|
81
130
|
# some code .....
|
|
82
131
|
debugger
|
|
83
132
|
# some more code ....
|
|
84
|
-
|
|
133
|
+
|
|
85
134
|
... and using the <tt>--debugger</tt> or <tt>-u</tt> command line option.
|
|
86
135
|
|
|
87
136
|
spec path/to/file.rb --debugger
|
|
88
|
-
|
|
137
|
+
|
|
89
138
|
= Upgrade to rspec-1.2.0
|
|
90
139
|
|
|
91
140
|
== What's Changed
|
|
@@ -107,7 +156,7 @@ in your code:
|
|
|
107
156
|
|
|
108
157
|
* The matcher protocol has been improved. The old protocol is still supported,
|
|
109
158
|
but we added support for two new methods that speak a bit more clearly:
|
|
110
|
-
|
|
159
|
+
|
|
111
160
|
failure_message => failure_message_for_should
|
|
112
161
|
negative_failure_message => failure_message_for_should_not
|
|
113
162
|
|
data/bin/spec
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
|
|
2
|
+
rspec_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
3
|
+
$LOAD_PATH.unshift(rspec_dir) unless $LOAD_PATH.include?(rspec_dir)
|
|
3
4
|
require 'spec/autorun'
|
|
4
5
|
exit ::Spec::Runner::CommandLine.run
|
data/cucumber.yml
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
default: --require features features
|
|
1
|
+
default: --require features features -t ~@wip
|
|
2
2
|
pending: --require features features-pending
|
|
3
3
|
no_heckle: --require features features --exclude heckle
|
|
4
|
+
focus: --require features features -t focus
|
|
5
|
+
wip: --require features features -t @wip
|
data/examples/failing/README.txt
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"Why have failing examples?", you might ask.
|
|
2
2
|
|
|
3
|
-
They allow us to see failure messages. RSpec wants to provide meaningful and
|
|
3
|
+
They allow us to see failure messages. RSpec wants to provide meaningful and
|
|
4
|
+
helpful failure messages. The failures in this directory not only provide you
|
|
5
|
+
a way of seeing the failure messages, but they provide RSpec's own specs a way
|
|
6
|
+
of describing what they should look like and ensuring they stay correct.
|
|
4
7
|
|
|
5
|
-
To see the types of messages you can expect, stand in
|
|
8
|
+
To see the types of messages you can expect, stand in the root directory and
|
|
9
|
+
run:
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
bin/spec examples/failing/*.rb
|