rspec 1.2.8 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. data/History.rdoc +41 -2
  2. data/Manifest.txt +11 -10
  3. data/Rakefile +47 -22
  4. data/Ruby1.9.rdoc +1 -2
  5. data/Upgrade.rdoc +56 -7
  6. data/bin/spec +2 -1
  7. data/cucumber.yml +3 -1
  8. data/examples/failing/README.txt +7 -3
  9. data/examples/failing/failing_implicit_docstrings_example.rb +0 -2
  10. data/examples/failing/mocking_example.rb +0 -2
  11. data/examples/failing/partial_mock_example.rb +0 -2
  12. data/examples/failing/pending_example.rb +0 -2
  13. data/examples/failing/predicate_example.rb +0 -2
  14. data/examples/failing/team_spec.rb +0 -3
  15. data/examples/failing/timeout_behaviour.rb +0 -2
  16. data/examples/passing/custom_formatter.rb +0 -1
  17. data/examples/passing/dynamic_spec.rb +0 -2
  18. data/examples/passing/file_accessor.rb +1 -2
  19. data/examples/passing/file_accessor_spec.rb +1 -2
  20. data/examples/passing/filtered_formatter.rb +0 -1
  21. data/examples/passing/greeter_spec.rb +0 -1
  22. data/examples/passing/helper_method_example.rb +0 -2
  23. data/examples/passing/implicit_docstrings_example.rb +0 -2
  24. data/examples/passing/io_processor_spec.rb +1 -2
  25. data/examples/passing/mocking_example.rb +0 -2
  26. data/examples/passing/nested_classes_example.rb +1 -2
  27. data/examples/passing/options_example.rb +0 -2
  28. data/examples/passing/partial_mock_example.rb +0 -2
  29. data/examples/passing/pending_example.rb +0 -2
  30. data/examples/passing/predicate_example.rb +0 -2
  31. data/examples/passing/shared_example_group_example.rb +0 -2
  32. data/examples/passing/simple_matcher_example.rb +0 -2
  33. data/examples/passing/stack_spec.rb +2 -3
  34. data/examples/passing/stack_spec_with_nested_example_groups.rb +2 -3
  35. data/examples/passing/stubbing_example.rb +0 -2
  36. data/examples/passing/yielding_example.rb +0 -2
  37. data/features/before_and_after_blocks/before_and_after_blocks.feature +4 -4
  38. data/features/command_line/line_number_option.feature +14 -14
  39. data/features/command_line/line_number_option_with_example_with_no_name.feature +2 -2
  40. data/features/example_groups/define_example_attribute.feature +41 -0
  41. data/features/example_groups/example_group_with_should_methods.feature +1 -1
  42. data/features/example_groups/implicit_docstrings.feature +7 -7
  43. data/features/example_groups/nested_groups.feature +2 -2
  44. data/features/expectations/customized_message.feature +4 -4
  45. data/features/expectations/expect_change.feature +4 -4
  46. data/features/expectations/expect_error.feature +4 -4
  47. data/features/extensions/custom_example_group.feature +10 -10
  48. data/features/formatters/custom_formatter.feature +3 -3
  49. data/features/interop/examples_and_tests_together.feature +10 -6
  50. data/features/interop/rspec_output.feature +1 -1
  51. data/features/interop/test_case_with_should_methods.feature +1 -1
  52. data/features/load_paths/add_lib_to_load_path.feature +20 -0
  53. data/features/load_paths/add_spec_to_load_path.feature +20 -0
  54. data/features/matchers/define_diffable_matcher.feature +2 -2
  55. data/features/matchers/define_matcher.feature +19 -19
  56. data/features/matchers/define_matcher_outside_rspec.feature +2 -3
  57. data/features/matchers/define_matcher_with_fluent_interface.feature +2 -2
  58. data/features/matchers/define_wrapped_matcher.feature +29 -0
  59. data/features/mock_framework_integration/use_flexmock.feature +1 -1
  60. data/features/mock_framework_integration/use_mocha.feature +1 -1
  61. data/features/mock_framework_integration/use_rr.feature +1 -1
  62. data/features/mocks/mix_stubs_and_mocks.feature +2 -2
  63. data/features/mocks/stub_implementation.feature +1 -1
  64. data/features/pending/pending_examples.feature +16 -16
  65. data/features/runner/specify_line_number.feature +4 -4
  66. data/features/spec_helper/spec_helper.feature +25 -0
  67. data/features/step_definitions/running_rspec_steps.rb +4 -2
  68. data/features/subject/explicit_subject.feature +2 -2
  69. data/features/subject/implicit_subject.feature +14 -2
  70. data/features/support/env.rb +6 -3
  71. data/lib/spec/adapters/mock_frameworks/mocha.rb +6 -1
  72. data/lib/spec/example/example_group_methods.rb +7 -0
  73. data/lib/spec/example/example_methods.rb +1 -1
  74. data/lib/spec/example/subject.rb +8 -0
  75. data/lib/spec/interop/test.rb +27 -1
  76. data/lib/spec/interop/test/unit/testcase.rb +1 -1
  77. data/lib/spec/matchers/exist.rb +2 -2
  78. data/lib/spec/matchers/extensions/instance_exec.rb +28 -20
  79. data/lib/spec/matchers/matcher.rb +21 -20
  80. data/lib/spec/mocks/argument_matchers.rb +17 -13
  81. data/lib/spec/mocks/error_generator.rb +14 -3
  82. data/lib/spec/mocks/{spec_methods.rb → example_methods.rb} +25 -11
  83. data/lib/spec/mocks/framework.rb +1 -1
  84. data/lib/spec/mocks/methods.rb +15 -0
  85. data/lib/spec/mocks/mock.rb +16 -10
  86. data/lib/spec/mocks/proxy.rb +1 -1
  87. data/lib/spec/rake/spectask.rb +3 -3
  88. data/lib/spec/runner/backtrace_tweaker.rb +41 -22
  89. data/lib/spec/runner/configuration.rb +18 -1
  90. data/lib/spec/runner/differs/default.rb +1 -1
  91. data/lib/spec/runner/drb_command_line.rb +5 -2
  92. data/lib/spec/runner/formatter/base_text_formatter.rb +8 -3
  93. data/lib/spec/runner/option_parser.rb +21 -15
  94. data/lib/spec/runner/options.rb +54 -23
  95. data/lib/spec/version.rb +3 -3
  96. data/resources/helpers/cmdline.rb +0 -1
  97. data/spec/autotest/autotest_helper.rb +4 -6
  98. data/spec/autotest/discover_spec.rb +2 -2
  99. data/spec/autotest/failed_results_re_spec.rb +1 -1
  100. data/spec/autotest/rspec_spec.rb +1 -1
  101. data/spec/spec/dsl/main_spec.rb +1 -1
  102. data/spec/spec/example/example_group_class_definition_spec.rb +1 -1
  103. data/spec/spec/example/example_group_factory_spec.rb +1 -1
  104. data/spec/spec/example/example_group_methods_spec.rb +21 -1
  105. data/spec/spec/example/example_group_proxy_spec.rb +1 -1
  106. data/spec/spec/example/example_group_spec.rb +1 -1
  107. data/spec/spec/example/example_matcher_spec.rb +1 -1
  108. data/spec/spec/example/example_methods_spec.rb +1 -1
  109. data/spec/spec/example/example_proxy_spec.rb +1 -1
  110. data/spec/spec/example/helper_method_spec.rb +1 -1
  111. data/spec/spec/example/nested_example_group_spec.rb +1 -1
  112. data/spec/spec/example/predicate_matcher_spec.rb +1 -1
  113. data/spec/spec/example/shared_example_group_spec.rb +1 -1
  114. data/spec/spec/example/subclassing_example_group_spec.rb +1 -1
  115. data/spec/spec/example/subject_spec.rb +17 -1
  116. data/spec/spec/expectations/differs/default_spec.rb +16 -3
  117. data/spec/spec/expectations/extensions/kernel_spec.rb +1 -1
  118. data/spec/spec/expectations/fail_with_spec.rb +1 -1
  119. data/spec/spec/expectations/handler_spec.rb +1 -1
  120. data/spec/spec/expectations/wrap_expectation_spec.rb +1 -1
  121. data/spec/spec/interop/test/unit/resources/test_case_with_various_names.rb +22 -0
  122. data/spec/spec/interop/test/unit/spec_spec.rb +1 -1
  123. data/spec/spec/interop/test/unit/test_unit_spec_helper.rb +2 -2
  124. data/spec/spec/interop/test/unit/testcase_spec.rb +7 -2
  125. data/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +1 -1
  126. data/spec/spec/matchers/be_close_spec.rb +1 -1
  127. data/spec/spec/matchers/be_instance_of_spec.rb +1 -1
  128. data/spec/spec/matchers/be_kind_of_spec.rb +1 -1
  129. data/spec/spec/matchers/be_spec.rb +13 -1
  130. data/spec/spec/matchers/change_spec.rb +1 -1
  131. data/spec/spec/matchers/compatibility_spec.rb +1 -1
  132. data/spec/spec/matchers/description_generation_spec.rb +1 -1
  133. data/spec/spec/matchers/dsl_spec.rb +1 -1
  134. data/spec/spec/matchers/eql_spec.rb +1 -1
  135. data/spec/spec/matchers/equal_spec.rb +1 -1
  136. data/spec/spec/matchers/exist_spec.rb +6 -2
  137. data/spec/spec/matchers/has_spec.rb +19 -1
  138. data/spec/spec/matchers/have_spec.rb +1 -1
  139. data/spec/spec/matchers/include_spec.rb +1 -1
  140. data/spec/spec/matchers/match_array_spec.rb +1 -1
  141. data/spec/spec/matchers/match_spec.rb +1 -1
  142. data/spec/spec/matchers/matcher_methods_spec.rb +1 -1
  143. data/spec/spec/matchers/matcher_spec.rb +55 -28
  144. data/spec/spec/matchers/matchers_spec.rb +1 -1
  145. data/spec/spec/matchers/operator_matcher_spec.rb +1 -1
  146. data/spec/spec/matchers/raise_error_spec.rb +1 -1
  147. data/spec/spec/matchers/respond_to_spec.rb +1 -1
  148. data/spec/spec/matchers/satisfy_spec.rb +1 -1
  149. data/spec/spec/matchers/simple_matcher_spec.rb +1 -1
  150. data/spec/spec/matchers/throw_symbol_spec.rb +1 -1
  151. data/spec/spec/mocks/any_number_of_times_spec.rb +1 -1
  152. data/spec/spec/mocks/argument_expectation_spec.rb +1 -1
  153. data/spec/spec/mocks/argument_matchers_spec.rb +19 -0
  154. data/spec/spec/mocks/at_least_spec.rb +1 -1
  155. data/spec/spec/mocks/at_most_spec.rb +1 -1
  156. data/spec/spec/mocks/bug_report_10260_spec.rb +1 -1
  157. data/spec/spec/mocks/bug_report_10263_spec.rb +1 -1
  158. data/spec/spec/mocks/bug_report_11545_spec.rb +1 -1
  159. data/spec/spec/mocks/bug_report_15719_spec.rb +3 -3
  160. data/spec/spec/mocks/bug_report_496_spec.rb +1 -1
  161. data/spec/spec/mocks/bug_report_600_spec.rb +1 -1
  162. data/spec/spec/mocks/bug_report_7611_spec.rb +1 -1
  163. data/spec/spec/mocks/bug_report_7805_spec.rb +1 -1
  164. data/spec/spec/mocks/bug_report_8165_spec.rb +1 -1
  165. data/spec/spec/mocks/bug_report_8302_spec.rb +1 -1
  166. data/spec/spec/mocks/bug_report_830_spec.rb +1 -1
  167. data/spec/spec/mocks/double_spec.rb +12 -0
  168. data/spec/spec/mocks/failing_argument_matchers_spec.rb +6 -6
  169. data/spec/spec/mocks/hash_including_matcher_spec.rb +1 -1
  170. data/spec/spec/mocks/hash_not_including_matcher_spec.rb +1 -1
  171. data/spec/spec/mocks/mock_ordering_spec.rb +4 -4
  172. data/spec/spec/mocks/mock_space_spec.rb +1 -1
  173. data/spec/spec/mocks/mock_spec.rb +20 -24
  174. data/spec/spec/mocks/multiple_return_value_spec.rb +8 -8
  175. data/spec/spec/mocks/nil_expectation_warning_spec.rb +1 -1
  176. data/spec/spec/mocks/null_object_mock_spec.rb +1 -1
  177. data/spec/spec/mocks/once_counts_spec.rb +1 -1
  178. data/spec/spec/mocks/options_hash_spec.rb +1 -1
  179. data/spec/spec/mocks/partial_mock_spec.rb +1 -1
  180. data/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +1 -1
  181. data/spec/spec/mocks/passing_argument_matchers_spec.rb +1 -1
  182. data/spec/spec/mocks/precise_counts_spec.rb +1 -1
  183. data/spec/spec/mocks/record_messages_spec.rb +1 -1
  184. data/spec/spec/mocks/stub_chain_spec.rb +1 -1
  185. data/spec/spec/mocks/stub_implementation_spec.rb +1 -1
  186. data/spec/spec/mocks/stub_spec.rb +14 -9
  187. data/spec/spec/mocks/stubbed_message_expectations_spec.rb +2 -2
  188. data/spec/spec/mocks/twice_counts_spec.rb +1 -1
  189. data/spec/spec/mocks/unstub_spec.rb +1 -1
  190. data/spec/spec/package/bin_spec_spec.rb +4 -10
  191. data/spec/spec/rake/spectask_spec.rb +2 -2
  192. data/spec/spec/runner/class_and_argument_parser_spec.rb +1 -1
  193. data/spec/spec/runner/command_line_spec.rb +1 -1
  194. data/spec/spec/runner/configuration_spec.rb +15 -6
  195. data/spec/spec/runner/drb_command_line_spec.rb +1 -1
  196. data/spec/spec/runner/example_group_runner_spec.rb +1 -1
  197. data/spec/spec/runner/formatter/base_formatter_spec.rb +1 -1
  198. data/spec/spec/runner/formatter/base_text_formatter_spec.rb +10 -1
  199. data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +1 -1
  200. data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +1 -1
  201. data/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +72 -76
  202. data/spec/spec/runner/formatter/html_formatted-1.8.6.html +50 -50
  203. data/spec/spec/runner/formatter/html_formatted-1.8.7.html +50 -50
  204. data/spec/spec/runner/formatter/html_formatted-1.9.1.html +61 -69
  205. data/spec/spec/runner/formatter/html_formatter_spec.rb +26 -26
  206. data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +1 -1
  207. data/spec/spec/runner/formatter/profile_formatter_spec.rb +1 -1
  208. data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +13 -9
  209. data/spec/spec/runner/formatter/snippet_extractor_spec.rb +1 -1
  210. data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +1 -1
  211. data/spec/spec/runner/formatter/{text_mate_formatted-1.8.4.html → text_mate_formatted-1.8.6-jruby.html} +64 -59
  212. data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +46 -46
  213. data/spec/spec/runner/formatter/text_mate_formatted-1.8.7.html +46 -46
  214. data/spec/spec/runner/formatter/text_mate_formatted-1.9.1.html +55 -63
  215. data/spec/spec/runner/formatter/text_mate_formatter_spec.rb +3 -3
  216. data/spec/spec/runner/heckle_runner_spec.rb +1 -1
  217. data/spec/spec/runner/heckler_spec.rb +1 -1
  218. data/spec/spec/runner/line_number_query/line_number_query_fixture.rb +1 -1
  219. data/spec/spec/runner/line_number_query_spec.rb +10 -1
  220. data/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +22 -16
  221. data/spec/spec/runner/option_parser_spec.rb +48 -14
  222. data/spec/spec/runner/options_spec.rb +16 -2
  223. data/spec/spec/runner/output_one_time_fixture.rb +1 -1
  224. data/spec/spec/runner/output_one_time_fixture_runner.rb +2 -3
  225. data/spec/spec/runner/output_one_time_spec.rb +6 -7
  226. data/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +65 -22
  227. data/spec/spec/runner/reporter_spec.rb +1 -1
  228. data/spec/spec/runner_spec.rb +1 -1
  229. data/spec/spec_helper.rb +5 -7
  230. data/spec/{spec → support}/spec_classes.rb +0 -0
  231. metadata +58 -17
  232. data/examples/failing/spec_helper.rb +0 -3
  233. data/examples/passing/spec_helper.rb +0 -3
  234. data/features/heckle/heckle.feature +0 -56
  235. data/spec/rspec_suite.rb +0 -6
  236. data/spec/spec/runner/formatter/html_formatted-1.8.4.html +0 -366
  237. data/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +0 -387
  238. 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.8 / 2008-07-16
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.4.html
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(File.join(File.dirname(__FILE__), 'lib'))
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('rspec') do |hoe|
12
- hoe.version = Spec::VERSION::STRING
13
- hoe.summary = Spec::VERSION::SUMMARY
14
- hoe.description = "Behaviour Driven Development for Ruby."
15
- hoe.rubyforge_name = 'rspec'
16
- hoe.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
17
- hoe.extra_dev_deps = [["cucumber",">= 0.2.2"]]
18
- hoe.remote_rdoc_dir = "rspec/#{Spec::VERSION::STRING}"
19
- hoe.rspec_options = ['--options', 'spec/spec.opts']
20
- hoe.history_file = 'History.rdoc'
21
- hoe.readme_file = 'README.rdoc'
22
- hoe.post_install_message = <<-POST_INSTALL_MESSAGE
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 File.dirname(__FILE__) + '/resources/rake/examples.rake'
44
- load File.dirname(__FILE__) + '/resources/rake/examples_with_rcov.rake'
45
- load File.dirname(__FILE__) + '/resources/rake/failing_examples_with_html.rake'
46
- load File.dirname(__FILE__) + '/resources/rake/verify_rcov.rake'
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 => [:verify_rcov, :features]
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('rcov') do |t|
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
- task :features do
67
- sh(RUBY_VERSION =~ /^1.8/ ? "cucumber" : "cucumber --profile no_heckle")
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
@@ -1,7 +1,6 @@
1
1
  = RSpec and Ruby 1.9
2
2
 
3
- Currently, RSpec (core) is mostly compatible with Ruby 1.9.1. There are still
4
- outstanding issues, some of which we plan to address and some we don't.
3
+ RSpec runs on Ruby 1.9.1 with the following caveats.
5
4
 
6
5
  == Test::Unit
7
6
 
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
- $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
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
@@ -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 helpful failure messages. The failures in this directory not only provide you a way of seeing the failure messages, but they provide RSpec's own specs a way of describing what they should look like and ensuring they stay correct.
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 this directory and run:
8
+ To see the types of messages you can expect, stand in the root directory and
9
+ run:
6
10
 
7
- ../bin/spec ./*.rb
11
+ bin/spec examples/failing/*.rb
@@ -1,5 +1,3 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
1
  # Run spec w/ -fs to see the output of this file
4
2
 
5
3
  describe "Failing examples with no descriptions" do
@@ -1,5 +1,3 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
1
  describe "Mocker" do
4
2
 
5
3
  it "should be able to call mock()" do
@@ -1,5 +1,3 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
1
  class MockableClass
4
2
  def self.find id
5
3
  return :original_return
@@ -1,5 +1,3 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
1
  describe "pending example (which is fixed)" do
4
2
  it %Q|reports "FIXED ... Expected ... to fail. No Error was raised."| do
5
3
  pending("for some reason") do