rspec 1.1.12 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. data/.autotest +2 -1
  2. data/.document +7 -0
  3. data/History.txt +58 -0
  4. data/License.txt +1 -1
  5. data/Manifest.txt +45 -82
  6. data/README.txt +3 -6
  7. data/Rakefile +33 -13
  8. data/Ruby1.9.markdown +32 -0
  9. data/TODO.txt +10 -4
  10. data/Upgrade.markdown +63 -0
  11. data/bin/spec +1 -1
  12. data/cucumber.yml +3 -0
  13. data/examples/failing/{failing_autogenerated_docstrings_example.rb → failing_implicit_docstrings_example.rb} +0 -0
  14. data/examples/failing/pending_example.rb +9 -0
  15. data/examples/failing/spec_helper.rb +1 -1
  16. data/examples/passing/{custom_expectation_matchers.rb → custom_matchers.rb} +0 -0
  17. data/examples/passing/filtered_formatter.rb +18 -0
  18. data/examples/passing/filtered_formatter_example.rb +31 -0
  19. data/examples/passing/implicit_docstrings_example.rb +18 -0
  20. data/examples/passing/spec_helper.rb +1 -1
  21. data/examples/ruby1.9.compatibility/access_to_constants_spec.rb +17 -18
  22. data/features/before_and_after_blocks/before_and_after_blocks.feature +4 -4
  23. data/features/example_groups/example_group_with_should_methods.feature +1 -1
  24. data/features/example_groups/{autogenerated_docstrings.feature → implicit_docstrings.feature} +7 -9
  25. data/features/example_groups/nested_groups.feature +1 -1
  26. data/features/heckle/heckle.feature +56 -0
  27. data/features/interop/examples_and_tests_together.feature +1 -1
  28. data/features/interop/test_but_not_test_unit.feature +1 -1
  29. data/features/interop/test_case_with_should_methods.feature +1 -1
  30. data/features/matchers/create_matcher.feature +115 -0
  31. data/features/mock_framework_integration/use_flexmock.feature +22 -4
  32. data/features/mock_framework_integration/use_mocha.feature +27 -0
  33. data/features/mock_framework_integration/use_rr.feature +27 -0
  34. data/features/mocks/mix_stubs_and_mocks.feature +22 -0
  35. data/features/pending/pending_examples.feature +81 -0
  36. data/features/step_definitions/running_rspec.rb +5 -3
  37. data/features/support/env.rb +1 -1
  38. data/features/support/matchers/smart_match.rb +2 -2
  39. data/lib/autotest/rspec.rb +1 -1
  40. data/lib/spec.rb +1 -1
  41. data/lib/{adapters → spec/adapters}/mock_frameworks/flexmock.rb +0 -0
  42. data/lib/{adapters → spec/adapters}/mock_frameworks/mocha.rb +0 -0
  43. data/lib/{adapters → spec/adapters}/mock_frameworks/rr.rb +0 -0
  44. data/lib/{adapters → spec/adapters}/mock_frameworks/rspec.rb +0 -1
  45. data/lib/spec/autorun.rb +3 -0
  46. data/lib/spec/dsl.rb +3 -1
  47. data/lib/spec/dsl/matchers.rb +13 -0
  48. data/lib/spec/example.rb +4 -0
  49. data/lib/spec/example/before_and_after_hooks.rb +5 -20
  50. data/lib/spec/example/errors.rb +3 -3
  51. data/lib/spec/example/example_description.rb +15 -0
  52. data/lib/spec/example/example_group.rb +0 -15
  53. data/lib/spec/example/example_group_factory.rb +34 -46
  54. data/lib/spec/example/example_group_hierarchy.rb +53 -0
  55. data/lib/spec/example/example_group_methods.rb +101 -211
  56. data/lib/spec/example/example_methods.rb +61 -81
  57. data/lib/spec/example/module_reopening_fix.rb +23 -1
  58. data/lib/spec/example/pending.rb +3 -2
  59. data/lib/spec/example/predicate_matchers.rb +47 -0
  60. data/lib/spec/example/subject.rb +91 -0
  61. data/lib/spec/expectations.rb +1 -1
  62. data/lib/spec/expectations/differs/default.rb +0 -1
  63. data/lib/spec/expectations/extensions.rb +0 -1
  64. data/lib/spec/expectations/handler.rb +13 -6
  65. data/lib/spec/interop/test.rb +5 -0
  66. data/lib/spec/interop/test/unit/testcase.rb +5 -22
  67. data/lib/spec/matchers.rb +22 -8
  68. data/lib/spec/matchers/be.rb +4 -9
  69. data/lib/spec/matchers/be_close.rb +20 -5
  70. data/lib/spec/matchers/be_instance_of.rb +45 -0
  71. data/lib/spec/matchers/be_kind_of.rb +45 -0
  72. data/lib/spec/matchers/change.rb +8 -6
  73. data/lib/spec/matchers/compatibility.rb +14 -0
  74. data/lib/spec/matchers/eql.rb +24 -6
  75. data/lib/spec/matchers/equal.rb +24 -6
  76. data/lib/spec/matchers/exist.rb +21 -5
  77. data/lib/spec/matchers/extensions/instance_exec.rb +25 -0
  78. data/lib/spec/matchers/generated_descriptions.rb +2 -2
  79. data/lib/spec/matchers/has.rb +28 -11
  80. data/lib/spec/matchers/have.rb +2 -2
  81. data/lib/spec/matchers/include.rb +2 -2
  82. data/lib/spec/matchers/match.rb +25 -7
  83. data/lib/spec/matchers/match_array.rb +3 -3
  84. data/lib/spec/matchers/matcher.rb +51 -0
  85. data/lib/spec/matchers/method_missing.rb +2 -2
  86. data/lib/spec/matchers/operator_matcher.rb +12 -5
  87. data/lib/spec/matchers/raise_error.rb +3 -3
  88. data/lib/spec/matchers/respond_to.rb +3 -3
  89. data/lib/spec/matchers/satisfy.rb +7 -7
  90. data/lib/spec/matchers/throw_symbol.rb +3 -5
  91. data/lib/spec/mocks.rb +3 -3
  92. data/lib/spec/mocks/argument_expectation.rb +15 -15
  93. data/lib/spec/mocks/{argument_constraints.rb → argument_matchers.rb} +19 -23
  94. data/lib/spec/mocks/error_generator.rb +5 -8
  95. data/lib/spec/mocks/framework.rb +1 -1
  96. data/lib/spec/mocks/message_expectation.rb +5 -13
  97. data/lib/spec/mocks/mock.rb +4 -5
  98. data/lib/spec/mocks/proxy.rb +9 -5
  99. data/lib/spec/mocks/spec_methods.rb +10 -1
  100. data/lib/spec/rake/spectask.rb +0 -1
  101. data/lib/spec/runner.rb +6 -28
  102. data/lib/spec/runner/configuration.rb +3 -3
  103. data/lib/spec/runner/drb_command_line.rb +2 -1
  104. data/lib/spec/runner/example_group_runner.rb +3 -2
  105. data/lib/spec/runner/formatter/base_text_formatter.rb +34 -19
  106. data/lib/spec/runner/formatter/failing_example_groups_formatter.rb +3 -5
  107. data/lib/spec/runner/formatter/html_formatter.rb +2 -3
  108. data/lib/spec/runner/formatter/nested_text_formatter.rb +7 -25
  109. data/lib/spec/runner/formatter/progress_bar_formatter.rb +1 -1
  110. data/lib/spec/runner/formatter/snippet_extractor.rb +1 -1
  111. data/lib/spec/runner/formatter/specdoc_formatter.rb +1 -7
  112. data/lib/spec/runner/heckle_runner.rb +3 -6
  113. data/lib/spec/runner/heckle_runner_unsupported.rb +1 -1
  114. data/lib/spec/runner/option_parser.rb +19 -21
  115. data/lib/spec/runner/options.rb +32 -27
  116. data/lib/spec/runner/reporter.rb +8 -9
  117. data/lib/spec/test/unit.rb +10 -0
  118. data/lib/spec/version.rb +2 -2
  119. data/{features/support → resources}/helpers/cmdline.rb +2 -2
  120. data/resources/rake/verify_rcov.rake +1 -1
  121. data/resources/spec/example_group_with_should_methods.rb +1 -1
  122. data/resources/spec/simple_spec.rb +1 -1
  123. data/resources/test/spec_and_test_together.rb +2 -3
  124. data/resources/test/spec_including_test_but_not_unit.rb +1 -1
  125. data/resources/test/test_case_with_should_methods.rb +2 -3
  126. data/spec/autotest/autotest_helper.rb +0 -1
  127. data/spec/autotest/rspec_spec.rb +95 -98
  128. data/spec/spec/dsl/main_spec.rb +3 -3
  129. data/spec/spec/dsl/matchers_spec.rb +25 -0
  130. data/spec/spec/example/example_group_class_definition_spec.rb +14 -15
  131. data/spec/spec/example/example_group_factory_spec.rb +31 -44
  132. data/spec/spec/example/example_group_methods_spec.rb +86 -52
  133. data/spec/spec/example/example_group_spec.rb +32 -79
  134. data/spec/spec/example/example_matcher_spec.rb +10 -10
  135. data/spec/spec/example/example_methods_spec.rb +108 -242
  136. data/spec/spec/example/nested_example_group_spec.rb +2 -2
  137. data/spec/spec/example/pending_module_spec.rb +66 -41
  138. data/spec/spec/example/shared_example_group_spec.rb +4 -4
  139. data/spec/spec/{matchers → expectations}/handler_spec.rb +52 -4
  140. data/spec/spec/interop/test/unit/resources/spec_that_fails.rb +2 -2
  141. data/spec/spec/interop/test/unit/resources/spec_that_passes.rb +2 -2
  142. data/spec/spec/interop/test/unit/resources/spec_with_errors.rb +2 -2
  143. data/spec/spec/interop/test/unit/resources/spec_with_options_hash.rb +2 -2
  144. data/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +2 -2
  145. data/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +2 -2
  146. data/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +2 -2
  147. data/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +2 -2
  148. data/spec/spec/interop/test/unit/testcase_spec.rb +0 -4
  149. data/spec/spec/matchers/be_close_spec.rb +1 -1
  150. data/spec/spec/matchers/be_instance_of_spec.rb +29 -0
  151. data/spec/spec/matchers/be_kind_of_spec.rb +29 -0
  152. data/spec/spec/matchers/change_spec.rb +20 -0
  153. data/spec/spec/matchers/compatibility_spec.rb +34 -0
  154. data/spec/spec/matchers/description_generation_spec.rb +0 -12
  155. data/spec/spec/matchers/eql_spec.rb +2 -2
  156. data/spec/spec/matchers/equal_spec.rb +2 -2
  157. data/spec/spec/matchers/exist_spec.rb +8 -4
  158. data/spec/spec/matchers/have_spec.rb +4 -4
  159. data/spec/spec/matchers/match_spec.rb +2 -2
  160. data/spec/spec/matchers/matcher_methods_spec.rb +1 -1
  161. data/spec/spec/matchers/matcher_spec.rb +97 -0
  162. data/spec/spec/matchers/throw_symbol_spec.rb +8 -8
  163. data/spec/spec/mocks/{bug_report_496.rb → bug_report_496_spec.rb} +0 -0
  164. data/spec/spec/mocks/{failing_mock_argument_constraints_spec.rb → failing_argument_matchers_spec.rb} +2 -2
  165. data/spec/spec/mocks/hash_including_matcher_spec.rb +4 -4
  166. data/spec/spec/mocks/hash_not_including_matcher_spec.rb +3 -3
  167. data/spec/spec/mocks/mock_spec.rb +27 -2
  168. data/spec/spec/mocks/nil_expectation_warning_spec.rb +1 -1
  169. data/spec/spec/mocks/partial_mock_spec.rb +18 -3
  170. data/spec/spec/mocks/{passing_mock_argument_constraints_spec.rb → passing_argument_matchers_spec.rb} +6 -6
  171. data/spec/spec/mocks/stubbed_message_expectations_spec.rb +13 -1
  172. data/spec/spec/package/bin_spec_spec.rb +2 -2
  173. data/spec/spec/runner/configuration_spec.rb +12 -12
  174. data/spec/spec/runner/drb_command_line_spec.rb +71 -73
  175. data/spec/spec/runner/formatter/base_text_formatter_spec.rb +82 -1
  176. data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +8 -8
  177. data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +4 -4
  178. data/spec/spec/runner/formatter/html_formatted-1.8.6.html +8 -8
  179. data/spec/spec/runner/formatter/html_formatted-1.8.7.html +38 -26
  180. data/spec/spec/runner/formatter/html_formatted-1.9.1.html +61 -53
  181. data/spec/spec/runner/formatter/html_formatter_spec.rb +100 -48
  182. data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +20 -34
  183. data/spec/spec/runner/formatter/profile_formatter_spec.rb +2 -1
  184. data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +9 -6
  185. data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +6 -6
  186. data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +20 -20
  187. data/spec/spec/runner/formatter/text_mate_formatted-1.8.7.html +38 -26
  188. data/spec/spec/runner/formatter/text_mate_formatted-1.9.1.html +55 -47
  189. data/spec/spec/runner/formatter/{spec_mate_formatter_spec.rb → text_mate_formatter_spec.rb} +11 -9
  190. data/spec/spec/runner/heckle_runner_spec.rb +1 -1
  191. data/spec/spec/runner/heckler_spec.rb +1 -1
  192. data/spec/spec/runner/option_parser_spec.rb +28 -11
  193. data/spec/spec/runner/options_spec.rb +34 -0
  194. data/spec/spec/runner/reporter_spec.rb +66 -62
  195. data/spec/spec/runner/resources/utf8_encoded.rb +1 -0
  196. data/spec/spec/runner/spec_drb.opts +1 -0
  197. data/spec/spec/runner_spec.rb +7 -5
  198. data/spec/spec_helper.rb +24 -2
  199. metadata +49 -90
  200. data/examples/passing/autogenerated_docstrings_example.rb +0 -25
  201. data/examples/passing/before_and_after_example.rb +0 -40
  202. data/examples/passing/behave_as_example.rb +0 -45
  203. data/examples/passing/legacy_spec.rb +0 -11
  204. data/examples/passing/priority.txt +0 -1
  205. data/features/support/helpers/story_helper.rb +0 -16
  206. data/lib/spec/expectations/extensions/string_and_symbol.rb +0 -17
  207. data/lib/spec/runner/formatter/story/html_formatter.rb +0 -174
  208. data/lib/spec/runner/formatter/story/plain_text_formatter.rb +0 -194
  209. data/lib/spec/runner/formatter/story/progress_bar_formatter.rb +0 -42
  210. data/lib/spec/story.rb +0 -10
  211. data/lib/spec/story/extensions.rb +0 -3
  212. data/lib/spec/story/extensions/main.rb +0 -86
  213. data/lib/spec/story/extensions/regexp.rb +0 -9
  214. data/lib/spec/story/extensions/string.rb +0 -9
  215. data/lib/spec/story/given_scenario.rb +0 -14
  216. data/lib/spec/story/runner.rb +0 -57
  217. data/lib/spec/story/runner/plain_text_story_runner.rb +0 -48
  218. data/lib/spec/story/runner/scenario_collector.rb +0 -18
  219. data/lib/spec/story/runner/scenario_runner.rb +0 -54
  220. data/lib/spec/story/runner/story_mediator.rb +0 -137
  221. data/lib/spec/story/runner/story_parser.rb +0 -247
  222. data/lib/spec/story/runner/story_runner.rb +0 -74
  223. data/lib/spec/story/scenario.rb +0 -14
  224. data/lib/spec/story/step.rb +0 -70
  225. data/lib/spec/story/step_group.rb +0 -89
  226. data/lib/spec/story/step_mother.rb +0 -38
  227. data/lib/spec/story/story.rb +0 -39
  228. data/lib/spec/story/world.rb +0 -124
  229. data/resources/spec/spec_with_flexmock.rb +0 -19
  230. data/rspec.gemspec +0 -32
  231. data/spec/spec/matchers/mock_constraint_matchers_spec.rb +0 -24
  232. data/spec/spec/runner/formatter/story/html_formatter_spec.rb +0 -135
  233. data/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +0 -600
  234. data/spec/spec/runner/formatter/story/progress_bar_formatter_spec.rb +0 -82
  235. data/spec/spec/spec_spec.rb +0 -21
  236. data/spec/spec/story/builders.rb +0 -46
  237. data/spec/spec/story/extensions/main_spec.rb +0 -161
  238. data/spec/spec/story/extensions_spec.rb +0 -14
  239. data/spec/spec/story/given_scenario_spec.rb +0 -27
  240. data/spec/spec/story/runner/plain_text_story_runner_spec.rb +0 -90
  241. data/spec/spec/story/runner/scenario_collector_spec.rb +0 -27
  242. data/spec/spec/story/runner/scenario_runner_spec.rb +0 -214
  243. data/spec/spec/story/runner/story_mediator_spec.rb +0 -143
  244. data/spec/spec/story/runner/story_parser_spec.rb +0 -401
  245. data/spec/spec/story/runner/story_runner_spec.rb +0 -294
  246. data/spec/spec/story/runner_spec.rb +0 -93
  247. data/spec/spec/story/scenario_spec.rb +0 -18
  248. data/spec/spec/story/step_group_spec.rb +0 -157
  249. data/spec/spec/story/step_mother_spec.rb +0 -84
  250. data/spec/spec/story/step_spec.rb +0 -272
  251. data/spec/spec/story/story_helper.rb +0 -2
  252. data/spec/spec/story/story_spec.rb +0 -84
  253. data/spec/spec/story/world_spec.rb +0 -423
  254. data/story_server/prototype/javascripts/builder.js +0 -136
  255. data/story_server/prototype/javascripts/controls.js +0 -972
  256. data/story_server/prototype/javascripts/dragdrop.js +0 -976
  257. data/story_server/prototype/javascripts/effects.js +0 -1117
  258. data/story_server/prototype/javascripts/prototype.js +0 -4140
  259. data/story_server/prototype/javascripts/rspec.js +0 -149
  260. data/story_server/prototype/javascripts/scriptaculous.js +0 -58
  261. data/story_server/prototype/javascripts/slider.js +0 -276
  262. data/story_server/prototype/javascripts/sound.js +0 -55
  263. data/story_server/prototype/javascripts/unittest.js +0 -568
  264. data/story_server/prototype/lib/server.rb +0 -24
  265. data/story_server/prototype/stories.html +0 -176
  266. data/story_server/prototype/stylesheets/rspec.css +0 -136
  267. data/story_server/prototype/stylesheets/test.css +0 -90
data/.autotest CHANGED
@@ -1,4 +1,5 @@
1
1
  Autotest.add_hook :initialize do |at|
2
2
  at.add_exception("spec/interop/test/unit/resources")
3
3
  at.add_exception("spec/spec/runner/drb_command_line_spec.rb")
4
- end
4
+ end
5
+
@@ -0,0 +1,7 @@
1
+ features/**/*.feature
2
+ lib/**/*.rb
3
+ History.txt
4
+ License.txt
5
+ README.txt
6
+ Ruby1.9.markdown
7
+ Upgrade.markdown
@@ -1,3 +1,61 @@
1
+ === Version 1.2.0
2
+
3
+ WARNINGS:
4
+
5
+ * If you use the ruby command to run specs instead of the spec command, you'll
6
+ need to require 'spec/autorun' or they won't run. This won't affect you if
7
+ you use the spec command or the Spec::Rake::SpecTask that ships with RSpec.
8
+
9
+ * require 'spec/test/unit' to invoke test/unit interop if you're using
10
+ RSpec's core (this is handled implicitly with spec-rails)
11
+
12
+ * setup and teardown are gone - use before and after instead
13
+
14
+ * you can still use setup and teardown if you're using
15
+ Test::Unit::TestCase as the base ExampleGroup class (which is implicit
16
+ in rspec-rails)
17
+
18
+ * The matcher protocol has been improved. The old protocol is still
19
+ supported, so as long as you're not monkey patching rspec's built-in
20
+ matchers, or using extension libraries that do, this should not affect
21
+ you. If you run into trouble, you'll just need to change:
22
+
23
+ * failure_message => failure_message_for_should
24
+ * negative_failure_message => failure_message_for_should_not
25
+
26
+ * All references to rubygems have been removed from within rspec's code.
27
+
28
+ * See http://gist.github.com/54177 for rationale and suggestions on
29
+ alternative approaches to loading rubygems
30
+
31
+ * deprecations
32
+
33
+ * BaseTextFormatter#colourize - use colorize_failure instead.
34
+ * BaseTextFormatter#magenta - use red instead.
35
+
36
+ * enhancements
37
+
38
+ * cleaner integration with with heckle-1.4.2
39
+ * allow registering example groups with a path-like key (Pat Maddox)
40
+ * start DRb service at "druby://localhost:0" (Hongli Lai) - See http://redmine.ruby-lang.org/issues/show/496
41
+ * consistent reporting of errors as failures
42
+ * added spec/test/unit as more intuitive path to loading test/unit interop lib
43
+ * added explicit autorun feature for running specs with ruby command
44
+ * added handling for does_not_match? for matchers that want to know the context in which they were called
45
+ * lots of ruby 1.9.1 compatibility fixes from Chad Humprhies
46
+ * improved feedback from be_kind_of/be_a_kind_of/be_instance_of/be_an_instance_of (Jakub Šťastný)
47
+ * added --format silent (l) option, which is now the default when running --heckle (Bob Aman)
48
+ * sexy new custom matcher creation (Corey Haines & David Chelimsky - initial concept by Yehuda Katz)
49
+ * improved matcher protocol - old one is still supported, but new one is cleaner and prefered
50
+
51
+ * bug fixes
52
+
53
+ * support delegating operator matchers to subject with should_not
54
+ * all arguments are included if --drb is specified in spec.opts (Neil Buckley). Closes #671.
55
+ * added --autospec option hack (used internally) to get --color to work when using --drb and autospec.
56
+ * Fixed mock framework failure message bug in which similar calls were excluded from the output
57
+ * cryptic error message on change.rb when the from value is wrong (Michael Murray). Closes #706.
58
+
1
59
  === Version 1.1.12 / 2009-01-11
2
60
 
3
61
  WARNING: there was a stub/mock bug in 1.1.11 that allowed a structure that was
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2005-2008 The RSpec Development Team
3
+ Copyright (c) 2005-2009 The RSpec Development Team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
@@ -1,15 +1,19 @@
1
1
  .autotest
2
+ .document
2
3
  History.txt
3
4
  License.txt
4
5
  Manifest.txt
5
6
  README.txt
6
7
  Rakefile
8
+ Ruby1.9.markdown
7
9
  TODO.txt
10
+ Upgrade.markdown
8
11
  bin/autospec
9
12
  bin/spec
13
+ cucumber.yml
10
14
  examples/failing/README.txt
11
15
  examples/failing/diffing_spec.rb
12
- examples/failing/failing_autogenerated_docstrings_example.rb
16
+ examples/failing/failing_implicit_docstrings_example.rb
13
17
  examples/failing/failure_in_after.rb
14
18
  examples/failing/failure_in_before.rb
15
19
  examples/failing/mocking_example.rb
@@ -17,32 +21,31 @@ examples/failing/mocking_with_flexmock.rb
17
21
  examples/failing/mocking_with_mocha.rb
18
22
  examples/failing/mocking_with_rr.rb
19
23
  examples/failing/partial_mock_example.rb
24
+ examples/failing/pending_example.rb
20
25
  examples/failing/predicate_example.rb
21
26
  examples/failing/raising_example.rb
22
27
  examples/failing/spec_helper.rb
23
28
  examples/failing/syntax_error_example.rb
24
29
  examples/failing/team_spec.rb
25
30
  examples/failing/timeout_behaviour.rb
26
- examples/passing/autogenerated_docstrings_example.rb
27
- examples/passing/before_and_after_example.rb
28
- examples/passing/behave_as_example.rb
29
- examples/passing/custom_expectation_matchers.rb
30
31
  examples/passing/custom_formatter.rb
32
+ examples/passing/custom_matchers.rb
31
33
  examples/passing/dynamic_spec.rb
32
34
  examples/passing/file_accessor.rb
33
35
  examples/passing/file_accessor_spec.rb
36
+ examples/passing/filtered_formatter.rb
37
+ examples/passing/filtered_formatter_example.rb
34
38
  examples/passing/greeter_spec.rb
35
39
  examples/passing/helper_method_example.rb
40
+ examples/passing/implicit_docstrings_example.rb
36
41
  examples/passing/io_processor.rb
37
42
  examples/passing/io_processor_spec.rb
38
- examples/passing/legacy_spec.rb
39
43
  examples/passing/mocking_example.rb
40
44
  examples/passing/multi_threaded_example_group_runner.rb
41
45
  examples/passing/nested_classes_example.rb
42
46
  examples/passing/partial_mock_example.rb
43
47
  examples/passing/pending_example.rb
44
48
  examples/passing/predicate_example.rb
45
- examples/passing/priority.txt
46
49
  examples/passing/shared_example_group_example.rb
47
50
  examples/passing/shared_stack_examples.rb
48
51
  examples/passing/simple_matcher_example.rb
@@ -54,46 +57,55 @@ examples/passing/stubbing_example.rb
54
57
  examples/passing/yielding_example.rb
55
58
  examples/ruby1.9.compatibility/access_to_constants_spec.rb
56
59
  features/before_and_after_blocks/before_and_after_blocks.feature
57
- features/example_groups/autogenerated_docstrings.feature
58
60
  features/example_groups/example_group_with_should_methods.feature
61
+ features/example_groups/implicit_docstrings.feature
59
62
  features/example_groups/nested_groups.feature
60
63
  features/example_groups/output.feature
64
+ features/heckle/heckle.feature
61
65
  features/interop/examples_and_tests_together.feature
62
66
  features/interop/test_but_not_test_unit.feature
63
67
  features/interop/test_case_with_should_methods.feature
68
+ features/matchers/create_matcher.feature
64
69
  features/mock_framework_integration/use_flexmock.feature
70
+ features/mock_framework_integration/use_mocha.feature
71
+ features/mock_framework_integration/use_rr.feature
72
+ features/mocks/mix_stubs_and_mocks.feature
73
+ features/pending/pending_examples.feature
65
74
  features/step_definitions/running_rspec.rb
66
75
  features/support/env.rb
67
- features/support/helpers/cmdline.rb
68
- features/support/helpers/story_helper.rb
69
76
  features/support/matchers/smart_match.rb
70
77
  init.rb
71
- lib/adapters/mock_frameworks/flexmock.rb
72
- lib/adapters/mock_frameworks/mocha.rb
73
- lib/adapters/mock_frameworks/rr.rb
74
- lib/adapters/mock_frameworks/rspec.rb
75
78
  lib/autotest/discover.rb
76
79
  lib/autotest/rspec.rb
77
80
  lib/spec.rb
81
+ lib/spec/adapters/mock_frameworks/flexmock.rb
82
+ lib/spec/adapters/mock_frameworks/mocha.rb
83
+ lib/spec/adapters/mock_frameworks/rr.rb
84
+ lib/spec/adapters/mock_frameworks/rspec.rb
85
+ lib/spec/autorun.rb
78
86
  lib/spec/dsl.rb
79
87
  lib/spec/dsl/main.rb
88
+ lib/spec/dsl/matchers.rb
80
89
  lib/spec/example.rb
81
90
  lib/spec/example/before_and_after_hooks.rb
82
91
  lib/spec/example/errors.rb
92
+ lib/spec/example/example_description.rb
83
93
  lib/spec/example/example_group.rb
84
94
  lib/spec/example/example_group_factory.rb
95
+ lib/spec/example/example_group_hierarchy.rb
85
96
  lib/spec/example/example_group_methods.rb
86
97
  lib/spec/example/example_matcher.rb
87
98
  lib/spec/example/example_methods.rb
88
99
  lib/spec/example/module_reopening_fix.rb
89
100
  lib/spec/example/pending.rb
101
+ lib/spec/example/predicate_matchers.rb
90
102
  lib/spec/example/shared_example_group.rb
103
+ lib/spec/example/subject.rb
91
104
  lib/spec/expectations.rb
92
105
  lib/spec/expectations/differs/default.rb
93
106
  lib/spec/expectations/errors.rb
94
107
  lib/spec/expectations/extensions.rb
95
108
  lib/spec/expectations/extensions/object.rb
96
- lib/spec/expectations/extensions/string_and_symbol.rb
97
109
  lib/spec/expectations/handler.rb
98
110
  lib/spec/interop/test.rb
99
111
  lib/spec/interop/test/unit/autorunner.rb
@@ -104,17 +116,22 @@ lib/spec/interop/test/unit/ui/console/testrunner.rb
104
116
  lib/spec/matchers.rb
105
117
  lib/spec/matchers/be.rb
106
118
  lib/spec/matchers/be_close.rb
119
+ lib/spec/matchers/be_instance_of.rb
120
+ lib/spec/matchers/be_kind_of.rb
107
121
  lib/spec/matchers/change.rb
122
+ lib/spec/matchers/compatibility.rb
108
123
  lib/spec/matchers/eql.rb
109
124
  lib/spec/matchers/equal.rb
110
125
  lib/spec/matchers/errors.rb
111
126
  lib/spec/matchers/exist.rb
127
+ lib/spec/matchers/extensions/instance_exec.rb
112
128
  lib/spec/matchers/generated_descriptions.rb
113
129
  lib/spec/matchers/has.rb
114
130
  lib/spec/matchers/have.rb
115
131
  lib/spec/matchers/include.rb
116
132
  lib/spec/matchers/match.rb
117
133
  lib/spec/matchers/match_array.rb
134
+ lib/spec/matchers/matcher.rb
118
135
  lib/spec/matchers/method_missing.rb
119
136
  lib/spec/matchers/operator_matcher.rb
120
137
  lib/spec/matchers/raise_error.rb
@@ -124,8 +141,8 @@ lib/spec/matchers/simple_matcher.rb
124
141
  lib/spec/matchers/throw_symbol.rb
125
142
  lib/spec/matchers/wrap_expectation.rb
126
143
  lib/spec/mocks.rb
127
- lib/spec/mocks/argument_constraints.rb
128
144
  lib/spec/mocks/argument_expectation.rb
145
+ lib/spec/mocks/argument_matchers.rb
129
146
  lib/spec/mocks/error_generator.rb
130
147
  lib/spec/mocks/errors.rb
131
148
  lib/spec/mocks/extensions.rb
@@ -158,9 +175,6 @@ lib/spec/runner/formatter/profile_formatter.rb
158
175
  lib/spec/runner/formatter/progress_bar_formatter.rb
159
176
  lib/spec/runner/formatter/snippet_extractor.rb
160
177
  lib/spec/runner/formatter/specdoc_formatter.rb
161
- lib/spec/runner/formatter/story/html_formatter.rb
162
- lib/spec/runner/formatter/story/plain_text_formatter.rb
163
- lib/spec/runner/formatter/story/progress_bar_formatter.rb
164
178
  lib/spec/runner/formatter/text_mate_formatter.rb
165
179
  lib/spec/runner/heckle_runner.rb
166
180
  lib/spec/runner/heckle_runner_unsupported.rb
@@ -168,37 +182,18 @@ lib/spec/runner/option_parser.rb
168
182
  lib/spec/runner/options.rb
169
183
  lib/spec/runner/reporter.rb
170
184
  lib/spec/runner/spec_parser.rb
171
- lib/spec/story.rb
172
- lib/spec/story/extensions.rb
173
- lib/spec/story/extensions/main.rb
174
- lib/spec/story/extensions/regexp.rb
175
- lib/spec/story/extensions/string.rb
176
- lib/spec/story/given_scenario.rb
177
- lib/spec/story/runner.rb
178
- lib/spec/story/runner/plain_text_story_runner.rb
179
- lib/spec/story/runner/scenario_collector.rb
180
- lib/spec/story/runner/scenario_runner.rb
181
- lib/spec/story/runner/story_mediator.rb
182
- lib/spec/story/runner/story_parser.rb
183
- lib/spec/story/runner/story_runner.rb
184
- lib/spec/story/scenario.rb
185
- lib/spec/story/step.rb
186
- lib/spec/story/step_group.rb
187
- lib/spec/story/step_mother.rb
188
- lib/spec/story/story.rb
189
- lib/spec/story/world.rb
185
+ lib/spec/test/unit.rb
190
186
  lib/spec/version.rb
187
+ resources/helpers/cmdline.rb
191
188
  resources/rake/examples.rake
192
189
  resources/rake/examples_with_rcov.rake
193
190
  resources/rake/failing_examples_with_html.rake
194
191
  resources/rake/verify_rcov.rake
195
192
  resources/spec/example_group_with_should_methods.rb
196
193
  resources/spec/simple_spec.rb
197
- resources/spec/spec_with_flexmock.rb
198
194
  resources/test/spec_and_test_together.rb
199
195
  resources/test/spec_including_test_but_not_unit.rb
200
196
  resources/test/test_case_with_should_methods.rb
201
- rspec.gemspec
202
197
  spec/README.jruby
203
198
  spec/autotest/autotest_helper.rb
204
199
  spec/autotest/autotest_matchers.rb
@@ -209,6 +204,7 @@ spec/rspec_suite.rb
209
204
  spec/ruby_forker.rb
210
205
  spec/spec.opts
211
206
  spec/spec/dsl/main_spec.rb
207
+ spec/spec/dsl/matchers_spec.rb
212
208
  spec/spec/example/example_group_class_definition_spec.rb
213
209
  spec/spec/example/example_group_factory_spec.rb
214
210
  spec/spec/example/example_group_methods_spec.rb
@@ -224,6 +220,7 @@ spec/spec/example/subclassing_example_group_spec.rb
224
220
  spec/spec/expectations/differs/default_spec.rb
225
221
  spec/spec/expectations/extensions/object_spec.rb
226
222
  spec/spec/expectations/fail_with_spec.rb
223
+ spec/spec/expectations/handler_spec.rb
227
224
  spec/spec/expectations/wrap_expectation_spec.rb
228
225
  spec/spec/interop/test/unit/resources/spec_that_fails.rb
229
226
  spec/spec/interop/test/unit/resources/spec_that_passes.rb
@@ -238,20 +235,22 @@ spec/spec/interop/test/unit/test_unit_spec_helper.rb
238
235
  spec/spec/interop/test/unit/testcase_spec.rb
239
236
  spec/spec/interop/test/unit/testsuite_adapter_spec.rb
240
237
  spec/spec/matchers/be_close_spec.rb
238
+ spec/spec/matchers/be_instance_of_spec.rb
239
+ spec/spec/matchers/be_kind_of_spec.rb
241
240
  spec/spec/matchers/be_spec.rb
242
241
  spec/spec/matchers/change_spec.rb
242
+ spec/spec/matchers/compatibility_spec.rb
243
243
  spec/spec/matchers/description_generation_spec.rb
244
244
  spec/spec/matchers/eql_spec.rb
245
245
  spec/spec/matchers/equal_spec.rb
246
246
  spec/spec/matchers/exist_spec.rb
247
- spec/spec/matchers/handler_spec.rb
248
247
  spec/spec/matchers/has_spec.rb
249
248
  spec/spec/matchers/have_spec.rb
250
249
  spec/spec/matchers/include_spec.rb
251
250
  spec/spec/matchers/match_array_spec.rb
252
251
  spec/spec/matchers/match_spec.rb
253
252
  spec/spec/matchers/matcher_methods_spec.rb
254
- spec/spec/matchers/mock_constraint_matchers_spec.rb
253
+ spec/spec/matchers/matcher_spec.rb
255
254
  spec/spec/matchers/operator_matcher_spec.rb
256
255
  spec/spec/matchers/raise_error_spec.rb
257
256
  spec/spec/matchers/respond_to_spec.rb
@@ -266,13 +265,13 @@ spec/spec/mocks/bug_report_10260_spec.rb
266
265
  spec/spec/mocks/bug_report_10263_spec.rb
267
266
  spec/spec/mocks/bug_report_11545_spec.rb
268
267
  spec/spec/mocks/bug_report_15719_spec.rb
269
- spec/spec/mocks/bug_report_496.rb
268
+ spec/spec/mocks/bug_report_496_spec.rb
270
269
  spec/spec/mocks/bug_report_600_spec.rb
271
270
  spec/spec/mocks/bug_report_7611_spec.rb
272
271
  spec/spec/mocks/bug_report_7805_spec.rb
273
272
  spec/spec/mocks/bug_report_8165_spec.rb
274
273
  spec/spec/mocks/bug_report_8302_spec.rb
275
- spec/spec/mocks/failing_mock_argument_constraints_spec.rb
274
+ spec/spec/mocks/failing_argument_matchers_spec.rb
276
275
  spec/spec/mocks/hash_including_matcher_spec.rb
277
276
  spec/spec/mocks/hash_not_including_matcher_spec.rb
278
277
  spec/spec/mocks/mock_ordering_spec.rb
@@ -285,7 +284,7 @@ spec/spec/mocks/once_counts_spec.rb
285
284
  spec/spec/mocks/options_hash_spec.rb
286
285
  spec/spec/mocks/partial_mock_spec.rb
287
286
  spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb
288
- spec/spec/mocks/passing_mock_argument_constraints_spec.rb
287
+ spec/spec/mocks/passing_argument_matchers_spec.rb
289
288
  spec/spec/mocks/precise_counts_spec.rb
290
289
  spec/spec/mocks/record_messages_spec.rb
291
290
  spec/spec/mocks/stub_spec.rb
@@ -316,15 +315,12 @@ spec/spec/runner/formatter/nested_text_formatter_spec.rb
316
315
  spec/spec/runner/formatter/profile_formatter_spec.rb
317
316
  spec/spec/runner/formatter/progress_bar_formatter_spec.rb
318
317
  spec/spec/runner/formatter/snippet_extractor_spec.rb
319
- spec/spec/runner/formatter/spec_mate_formatter_spec.rb
320
318
  spec/spec/runner/formatter/specdoc_formatter_spec.rb
321
- spec/spec/runner/formatter/story/html_formatter_spec.rb
322
- spec/spec/runner/formatter/story/plain_text_formatter_spec.rb
323
- spec/spec/runner/formatter/story/progress_bar_formatter_spec.rb
324
319
  spec/spec/runner/formatter/text_mate_formatted-1.8.4.html
325
320
  spec/spec/runner/formatter/text_mate_formatted-1.8.6.html
326
321
  spec/spec/runner/formatter/text_mate_formatted-1.8.7.html
327
322
  spec/spec/runner/formatter/text_mate_formatted-1.9.1.html
323
+ spec/spec/runner/formatter/text_mate_formatter_spec.rb
328
324
  spec/spec/runner/heckle_runner_spec.rb
329
325
  spec/spec/runner/heckler_spec.rb
330
326
  spec/spec/runner/noisy_backtrace_tweaker_spec.rb
@@ -347,37 +343,4 @@ spec/spec/runner/spec_parser_spec.rb
347
343
  spec/spec/runner/spec_spaced.opts
348
344
  spec/spec/runner_spec.rb
349
345
  spec/spec/spec_classes.rb
350
- spec/spec/spec_spec.rb
351
- spec/spec/story/builders.rb
352
- spec/spec/story/extensions/main_spec.rb
353
- spec/spec/story/extensions_spec.rb
354
- spec/spec/story/given_scenario_spec.rb
355
- spec/spec/story/runner/plain_text_story_runner_spec.rb
356
- spec/spec/story/runner/scenario_collector_spec.rb
357
- spec/spec/story/runner/scenario_runner_spec.rb
358
- spec/spec/story/runner/story_mediator_spec.rb
359
- spec/spec/story/runner/story_parser_spec.rb
360
- spec/spec/story/runner/story_runner_spec.rb
361
- spec/spec/story/runner_spec.rb
362
- spec/spec/story/scenario_spec.rb
363
- spec/spec/story/step_group_spec.rb
364
- spec/spec/story/step_mother_spec.rb
365
- spec/spec/story/step_spec.rb
366
- spec/spec/story/story_helper.rb
367
- spec/spec/story/story_spec.rb
368
- spec/spec/story/world_spec.rb
369
346
  spec/spec_helper.rb
370
- story_server/prototype/javascripts/builder.js
371
- story_server/prototype/javascripts/controls.js
372
- story_server/prototype/javascripts/dragdrop.js
373
- story_server/prototype/javascripts/effects.js
374
- story_server/prototype/javascripts/prototype.js
375
- story_server/prototype/javascripts/rspec.js
376
- story_server/prototype/javascripts/scriptaculous.js
377
- story_server/prototype/javascripts/slider.js
378
- story_server/prototype/javascripts/sound.js
379
- story_server/prototype/javascripts/unittest.js
380
- story_server/prototype/lib/server.rb
381
- story_server/prototype/stories.html
382
- story_server/prototype/stylesheets/rspec.css
383
- story_server/prototype/stylesheets/test.css
data/README.txt CHANGED
@@ -12,10 +12,10 @@ examples.
12
12
 
13
13
  == FEATURES:
14
14
 
15
- * Spec::Example provides a framework for expressing executable code examples
15
+ * Spec::Example provides a framework for organizing executable code examples
16
16
  * Spec::Expectations adds #should and #should_not to every object
17
17
  * Spec::Matchers provides Expression Matchers for use with #should and #should_not
18
- * Spec::Mocks is a full featured mocking/stubbing library
18
+ * Spec::Mocks is a full featured mock object/stubbing library
19
19
 
20
20
  == SYNOPSIS:
21
21
 
@@ -51,7 +51,4 @@ examples.
51
51
 
52
52
  or
53
53
 
54
- git clone git://github.com/dchelimsky/rspec.git
55
- cd rspec
56
- rake gem
57
- rake install_gem
54
+ clone, build, install - See http://wiki.github.com/dchelimsky/rspec
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
1
  # -*- ruby -*-
2
2
 
3
3
  $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
4
- require 'rubygems'
5
4
  require 'hoe'
6
5
  require 'spec/version'
7
6
  require 'spec/rake/spectask'
@@ -22,34 +21,40 @@ Hoe.new('rspec', Spec::VERSION::STRING) do |p|
22
21
  p.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
23
22
  p.extra_dev_deps = [["cucumber",">= 0.1.13"]]
24
23
  p.remote_rdoc_dir = "rspec/#{Spec::VERSION::STRING}"
24
+ p.rspec_options = ['--options', 'spec/spec.opts']
25
25
  end
26
26
 
27
27
  ['audit','test','test_deps','default','post_blog'].each do |task|
28
28
  Rake.application.instance_variable_get('@tasks').delete(task)
29
29
  end
30
30
 
31
- task :verify_rcov => [:spec, :features]
32
- task :default => :verify_rcov
33
-
34
- # # Some of the tasks are in separate files since they are also part of the website documentation
31
+ # Some of the tasks are in separate files since they are also part of the website documentation
35
32
  load File.dirname(__FILE__) + '/resources/rake/examples.rake'
36
33
  load File.dirname(__FILE__) + '/resources/rake/examples_with_rcov.rake'
37
34
  load File.dirname(__FILE__) + '/resources/rake/failing_examples_with_html.rake'
38
35
  load File.dirname(__FILE__) + '/resources/rake/verify_rcov.rake'
39
36
 
40
- desc "Run all specs"
41
- Spec::Rake::SpecTask.new do |t|
42
- t.spec_files = FileList['spec/**/*_spec.rb']
43
- t.spec_opts = ['--options', 'spec/spec.opts']
44
- unless ENV['NO_RCOV']
37
+ if RUBY_VERSION =~ /^1.8/
38
+ task :default => [:verify_rcov, :features]
39
+ else
40
+ task :default => [:spec, :features]
41
+ end
42
+
43
+ namespace :spec do
44
+ desc "Run all specs with rcov"
45
+ Spec::Rake::SpecTask.new('rcov') do |t|
46
+ t.spec_files = FileList['spec/**/*_spec.rb']
47
+ t.spec_opts = ['--options', 'spec/spec.opts']
45
48
  t.rcov = true
46
49
  t.rcov_dir = 'coverage'
47
- t.rcov_opts = ['--text-report', '--exclude', "lib/spec.rb,lib/spec/runner.rb,spec\/spec,bin\/spec,examples,\/gems,\/Library\/Ruby,\.autotest,#{ENV['GEM_HOME']}"]
50
+ t.rcov_opts = ['--exclude', "instance_exec\.rb,lib/spec.rb,lib/spec/runner.rb,spec/spec,bin/spec,examples,/gems,/Library/Ruby,\.autotest,#{ENV['GEM_HOME']}"]
48
51
  end
49
52
  end
50
53
 
51
54
  desc "Run Cucumber features"
52
- Cucumber::Rake::Task.new do; end
55
+ task :features do
56
+ sh(RUBY_VERSION =~ /^1.8/ ? "cucumber" : "cucumber --profile no_heckle")
57
+ end
53
58
 
54
59
  desc "Run failing examples (see failure output)"
55
60
  Spec::Rake::SpecTask.new('failing_examples') do |t|
@@ -86,4 +91,19 @@ task :verify_committed do
86
91
  raise "\n!!! Do a git commit first !!!\n\n" if line =~ /^#\s*modified:/
87
92
  end
88
93
  end
89
- end
94
+ end
95
+
96
+ namespace :update do
97
+ desc "update the manfest"
98
+ task :manifest do
99
+ system %q[touch Manifest.txt; rake check_manifest | grep -v "(in " | patch]
100
+ end
101
+ end
102
+
103
+ task :clobber => :clobber_tmp
104
+
105
+ task :clobber_tmp do
106
+ cmd = %q[rm -r tmp]
107
+ puts cmd
108
+ system cmd if test ?d, 'tmp'
109
+ end