rspec-core 2.0.0.beta.22 → 2.6.4

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.
Files changed (173) hide show
  1. data/.gitignore +1 -0
  2. data/.rspec +0 -1
  3. data/.travis.yml +9 -0
  4. data/Changelog.md +305 -0
  5. data/Gemfile +45 -20
  6. data/Guardfile +5 -0
  7. data/License.txt +2 -1
  8. data/{README.markdown → README.md} +23 -5
  9. data/Rakefile +63 -32
  10. data/bin/autospec +13 -0
  11. data/bin/rspec +24 -2
  12. data/cucumber.yml +1 -1
  13. data/features/.nav +57 -0
  14. data/features/Autotest.md +38 -0
  15. data/features/README.md +17 -0
  16. data/features/Upgrade.md +320 -0
  17. data/features/command_line/README.md +28 -0
  18. data/features/command_line/configure.feature +18 -15
  19. data/features/command_line/example_name_option.feature +37 -23
  20. data/features/command_line/exit_status.feature +16 -31
  21. data/features/command_line/format_option.feature +73 -0
  22. data/features/command_line/line_number_appended_to_path.feature +25 -27
  23. data/features/command_line/line_number_option.feature +11 -10
  24. data/features/command_line/rake_task.feature +68 -0
  25. data/features/command_line/tag.feature +90 -0
  26. data/features/configuration/alias_example_to.feature +48 -0
  27. data/features/configuration/custom_settings.feature +8 -10
  28. data/features/configuration/fail_fast.feature +77 -0
  29. data/features/configuration/read_options_from_file.feature +42 -26
  30. data/features/example_groups/basic_structure.feature +55 -0
  31. data/features/example_groups/shared_context.feature +74 -0
  32. data/features/example_groups/shared_example_group.feature +56 -41
  33. data/features/expectation_framework_integration/configure_expectation_framework.feature +73 -0
  34. data/features/filtering/exclusion_filters.feature +69 -9
  35. data/features/filtering/if_and_unless.feature +168 -0
  36. data/features/filtering/inclusion_filters.feature +58 -26
  37. data/features/filtering/run_all_when_everything_filtered.feature +46 -0
  38. data/features/formatters/custom_formatter.feature +17 -13
  39. data/features/formatters/text_formatter.feature +43 -0
  40. data/features/helper_methods/arbitrary_methods.feature +40 -0
  41. data/features/helper_methods/let.feature +50 -0
  42. data/features/helper_methods/modules.feature +149 -0
  43. data/features/hooks/around_hooks.feature +99 -69
  44. data/features/hooks/before_and_after_hooks.feature +74 -40
  45. data/features/hooks/filtering.feature +227 -0
  46. data/features/metadata/current_example.feature +17 -0
  47. data/features/metadata/described_class.feature +17 -0
  48. data/features/metadata/user_defined.feature +111 -0
  49. data/features/mock_framework_integration/use_any_framework.feature +106 -0
  50. data/features/mock_framework_integration/use_flexmock.feature +84 -11
  51. data/features/mock_framework_integration/use_mocha.feature +85 -11
  52. data/features/mock_framework_integration/use_rr.feature +86 -11
  53. data/features/mock_framework_integration/use_rspec.feature +85 -11
  54. data/features/pending/pending_examples.feature +143 -5
  55. data/features/spec_files/arbitrary_file_suffix.feature +2 -2
  56. data/features/step_definitions/additional_cli_steps.rb +30 -0
  57. data/features/subject/attribute_of_subject.feature +93 -15
  58. data/features/subject/explicit_subject.feature +28 -17
  59. data/features/subject/implicit_receiver.feature +29 -0
  60. data/features/subject/implicit_subject.feature +9 -10
  61. data/features/support/env.rb +6 -1
  62. data/lib/autotest/discover.rb +1 -0
  63. data/lib/autotest/rspec2.rb +15 -11
  64. data/lib/rspec/autorun.rb +2 -0
  65. data/lib/rspec/core/backward_compatibility.rb +32 -3
  66. data/lib/rspec/core/command_line.rb +4 -28
  67. data/lib/rspec/core/command_line_configuration.rb +16 -16
  68. data/lib/rspec/core/configuration.rb +286 -89
  69. data/lib/rspec/core/configuration_options.rb +74 -40
  70. data/lib/rspec/core/deprecation.rb +1 -1
  71. data/lib/rspec/core/drb_command_line.rb +5 -11
  72. data/lib/rspec/core/dsl.rb +11 -0
  73. data/lib/rspec/core/example.rb +63 -39
  74. data/lib/rspec/core/example_group.rb +109 -59
  75. data/lib/rspec/core/expecting/with_rspec.rb +9 -0
  76. data/lib/rspec/core/expecting/with_stdlib.rb +9 -0
  77. data/lib/rspec/core/extensions/kernel.rb +1 -1
  78. data/lib/rspec/core/extensions.rb +0 -1
  79. data/lib/rspec/core/formatters/base_formatter.rb +30 -15
  80. data/lib/rspec/core/formatters/base_text_formatter.rb +68 -40
  81. data/lib/rspec/core/formatters/documentation_formatter.rb +4 -2
  82. data/lib/rspec/core/formatters/helpers.rb +0 -4
  83. data/lib/rspec/core/formatters/html_formatter.rb +146 -41
  84. data/lib/rspec/core/formatters/progress_formatter.rb +1 -0
  85. data/lib/rspec/core/formatters/snippet_extractor.rb +1 -1
  86. data/lib/rspec/core/formatters/text_mate_formatter.rb +3 -1
  87. data/lib/rspec/core/hooks.rb +56 -17
  88. data/lib/rspec/core/metadata.rb +75 -64
  89. data/lib/rspec/core/metadata_hash_builder.rb +93 -0
  90. data/lib/rspec/core/mocking/with_flexmock.rb +2 -0
  91. data/lib/rspec/core/mocking/with_mocha.rb +2 -0
  92. data/lib/rspec/core/mocking/with_rr.rb +2 -0
  93. data/lib/rspec/core/mocking/with_rspec.rb +3 -1
  94. data/lib/rspec/core/option_parser.rb +49 -7
  95. data/lib/rspec/core/pending.rb +22 -4
  96. data/lib/rspec/core/rake_task.rb +64 -28
  97. data/lib/rspec/core/reporter.rb +6 -5
  98. data/lib/rspec/core/ruby_project.rb +2 -2
  99. data/lib/rspec/core/runner.rb +50 -6
  100. data/lib/rspec/core/shared_context.rb +16 -0
  101. data/lib/rspec/core/shared_example_group.rb +19 -4
  102. data/lib/rspec/core/subject.rb +92 -65
  103. data/lib/rspec/core/version.rb +1 -1
  104. data/lib/rspec/core/world.rb +85 -27
  105. data/lib/rspec/core.rb +55 -24
  106. data/lib/rspec/monkey/spork/test_framework/rspec.rb +1 -0
  107. data/rspec-core.gemspec +4 -25
  108. data/script/FullBuildRakeFile +63 -0
  109. data/script/cucumber +1 -0
  110. data/script/full_build +1 -0
  111. data/script/spec +1 -0
  112. data/spec/autotest/discover_spec.rb +19 -0
  113. data/spec/autotest/failed_results_re_spec.rb +25 -9
  114. data/spec/autotest/rspec_spec.rb +32 -41
  115. data/spec/rspec/core/command_line_spec.rb +62 -7
  116. data/spec/rspec/core/configuration_options_spec.rb +216 -148
  117. data/spec/rspec/core/configuration_spec.rb +419 -108
  118. data/spec/rspec/core/deprecations_spec.rb +38 -1
  119. data/spec/rspec/core/drb_command_line_spec.rb +21 -56
  120. data/spec/rspec/core/example_group_spec.rb +366 -127
  121. data/spec/rspec/core/example_spec.rb +125 -45
  122. data/spec/rspec/core/formatters/base_formatter_spec.rb +61 -1
  123. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +134 -97
  124. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +7 -6
  125. data/spec/rspec/core/formatters/helpers_spec.rb +1 -1
  126. data/spec/rspec/core/formatters/html_formatted-1.8.6.html +199 -81
  127. data/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +195 -83
  128. data/spec/rspec/core/formatters/html_formatted-1.8.7.html +199 -81
  129. data/spec/rspec/core/formatters/html_formatted-1.9.1.html +206 -81
  130. data/spec/rspec/core/formatters/html_formatted-1.9.2.html +206 -61
  131. data/spec/rspec/core/formatters/html_formatter_spec.rb +17 -9
  132. data/spec/rspec/core/formatters/progress_formatter_spec.rb +1 -1
  133. data/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +199 -81
  134. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +195 -81
  135. data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +199 -81
  136. data/spec/rspec/core/formatters/text_mate_formatted-1.9.1.html +206 -81
  137. data/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +206 -81
  138. data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +22 -7
  139. data/spec/rspec/core/hooks_filtering_spec.rb +128 -5
  140. data/spec/rspec/core/hooks_spec.rb +90 -4
  141. data/spec/rspec/core/metadata_spec.rb +176 -163
  142. data/spec/rspec/core/option_parser_spec.rb +73 -6
  143. data/spec/rspec/core/pending_example_spec.rb +137 -35
  144. data/spec/rspec/core/rake_task_spec.rb +62 -29
  145. data/spec/rspec/core/reporter_spec.rb +20 -4
  146. data/spec/rspec/core/resources/formatter_specs.rb +25 -1
  147. data/spec/rspec/core/rspec_matchers_spec.rb +45 -0
  148. data/spec/rspec/core/runner_spec.rb +60 -10
  149. data/spec/rspec/core/shared_context_spec.rb +30 -0
  150. data/spec/rspec/core/shared_example_group_spec.rb +59 -23
  151. data/spec/rspec/core/subject_spec.rb +136 -0
  152. data/spec/rspec/core/world_spec.rb +211 -68
  153. data/spec/rspec/core_spec.rb +28 -0
  154. data/spec/spec_helper.rb +41 -24
  155. data/spec/support/matchers.rb +44 -13
  156. data/spec/support/shared_example_groups.rb +41 -0
  157. data/spec/support/spec_files.rb +44 -0
  158. data/spec.txt +1126 -0
  159. metadata +100 -170
  160. data/.treasure_map.rb +0 -23
  161. data/History.md +0 -30
  162. data/Upgrade.markdown +0 -150
  163. data/autotest/discover.rb +0 -2
  164. data/features/README.markdown +0 -12
  165. data/features/example_groups/describe_aliases.feature +0 -25
  166. data/features/example_groups/nested_groups.feature +0 -44
  167. data/features/hooks/described_class.feature +0 -14
  168. data/features/hooks/halt.feature +0 -26
  169. data/lib/rspec/core/around_proxy.rb +0 -14
  170. data/lib/rspec/core/extensions/object.rb +0 -15
  171. data/lib/rspec/core/formatters.rb +0 -8
  172. data/spec/ruby_forker.rb +0 -13
  173. data/specs.watchr +0 -59
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .rvmrc
1
2
  *.sw?
2
3
  .DS_Store
3
4
  coverage*
data/.rspec CHANGED
@@ -1 +0,0 @@
1
- --color
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ script: "bundle exec rake"
2
+ rvm:
3
+ - 1.8.6
4
+ - 1.8.7
5
+ - 1.9.1
6
+ - 1.9.2
7
+ - ree
8
+ - rbx
9
+ - jruby
data/Changelog.md ADDED
@@ -0,0 +1,305 @@
1
+ ### 2.6.4 / 2011-06-06
2
+
3
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.6.3...v2.6.4)
4
+
5
+ * Bug fixes
6
+ * Support exclusion filters in DRb. (Yann Lugrin)
7
+ * Fix --example escaping when run over DRb. (Elliot Winkler)
8
+ * Use standard ANSI codes for color formatting so colors work in a wider set
9
+ of color schemes.
10
+
11
+ ### 2.6.3 / 2011-05-24
12
+
13
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.6.2...v2.6.3)
14
+
15
+ * Bug fixes
16
+ * Explicitly convert exit code to integer, avoiding TypeError when return
17
+ value of run is IO object proxied by `DRb::DRbObject` (Julian Scheid)
18
+ * Clarify behavior of `--example` command line option
19
+ * Build using a rubygems-1.6.2 to avoid downstream yaml parsing error
20
+
21
+ ### 2.6.2 / 2011-05-21
22
+
23
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.6.1...v2.6.2)
24
+
25
+ * Bug fixes
26
+ * Warn rather than raise when HOME env var is not defined
27
+ * Properly merge command-line exclusions with default :if and :unless (joshcooper)
28
+
29
+ ### 2.6.1 / 2011-05-19
30
+
31
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.6.0...v2.6.1)
32
+
33
+ * Bug fixes
34
+ * Don't extend nil when filters are nil
35
+ * `require 'rspec/autorun'` when running rcov.
36
+
37
+ ### 2.6.0 / 2011-05-12
38
+
39
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.5.1...v2.6.0)
40
+
41
+ * Enhancements
42
+ * `shared_context` (Damian Nurzynski)
43
+ * extend groups matching specific metadata with:
44
+ * method definitions
45
+ * subject declarations
46
+ * let/let! declarations
47
+ * etc (anything you can do in a group)
48
+ * `its([:key])` works for any subject with #[]. (Peter Jaros)
49
+ * `treat_symbols_as_metadata_keys_with_true_values` (Myron Marston)
50
+ * Print a deprecation warning when you configure RSpec after defining
51
+ an example. All configuration should happen before any examples are
52
+ defined. (Myron Marston)
53
+ * Pass the exit status of a DRb run to the invoking process. This causes
54
+ specs run via DRb to not just return true or false. (Ilkka Laukkanen)
55
+ * Refactoring of `ConfigurationOptions#parse_options` (Rodrigo Rosenfeld Rosas)
56
+ * Report excluded filters in runner output (tip from andyl)
57
+ * Clean up messages for filters/tags.
58
+ * Restore --pattern/-P command line option from rspec-1
59
+ * Support false as well as true in config.full_backtrace= (Andreas Tolf Tolfsen)
60
+
61
+ * Bug fixes
62
+ * Don't stumble over an exception without a message (Hans Hasselberg)
63
+ * Remove non-ascii characters from comments that were choking rcov (Geoffrey
64
+ Byers)
65
+ * Fixed backtrace so it doesn't include lines from before the autorun at_exit
66
+ hook (Myron Marston)
67
+ * Include RSpec::Matchers when first example group is defined, rather
68
+ than just before running the examples. This works around an obscure
69
+ bug in ruby 1.9 that can cause infinite recursion. (Myron Marston)
70
+ * Don't send `example_group_[started|finished]` to formatters for empty groups.
71
+ * Get specs passing on jruby (Sidu Ponnappa)
72
+ * Fix bug where mixing nested groups and outer-level examples gave
73
+ unpredictable :line_number behavior (Artur Małecki)
74
+ * Regexp.escape the argument to --example (tip from Elliot Winkler)
75
+ * Correctly pass/fail pending block with message expectations
76
+ * CommandLine returns exit status (0/1) instead of true/false
77
+ * Create path to formatter output file if it doesn't exist (marekj).
78
+
79
+
80
+ ### 2.5.1 / 2011-02-06
81
+
82
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.5.0...v2.5.1)
83
+
84
+ NOTE: this release breaks compatibility with rspec/autotest/bundler
85
+ integration, but does so in order to greatly simplify it.
86
+
87
+ With this release, if you want the generated autotest command to include
88
+ 'bundle exec', require Autotest's bundler plugin in a .autotest file in the
89
+ project's root directory or in your home directory:
90
+
91
+ require "autotest/bundler"
92
+
93
+ Now you can just type 'autotest' on the commmand line and it will work as you expect.
94
+
95
+ If you don't want 'bundle exec', there is nothing you have to do.
96
+
97
+ ### 2.5.0 / 2011-02-05
98
+
99
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.4.0...v2.5.0)
100
+
101
+ * Enhancements
102
+ * Autotest::Rspec2 parses command line args passed to autotest after '--'
103
+ * --skip-bundler option for autotest command
104
+ * Autotest regexp fixes (Jon Rowe)
105
+ * Add filters to html and textmate formatters (Daniel Quimper)
106
+ * Explicit passing of block (need for JRuby 1.6) (John Firebaugh)
107
+
108
+ * Bug fixes
109
+ * fix dom IDs in HTML formatter (Brian Faherty)
110
+ * fix bug with --drb + formatters when not running in drb
111
+ * include --tag options in drb args (monocle)
112
+ * fix regression so now SPEC_OPTS take precedence over CLI options again
113
+ (Roman Chernyatchik)
114
+ * only call its(:attribute) once (failing example from Brian Dunn)
115
+ * fix bizarre bug where rspec would hang after String.alias :to_int :to_i
116
+ (Damian Nurzynski)
117
+
118
+ * Deprecations
119
+ * implicit inclusion of 'bundle exec' when Gemfile present (use autotest's
120
+ bundler plugin instead)
121
+
122
+ ### 2.4.0 / 2011-01-02
123
+
124
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.3.1...v2.4.0)
125
+
126
+ * Enhancements
127
+ * start the debugger on -d so the stack trace is visible when it stops
128
+ (Clifford Heath)
129
+ * apply hook filtering to examples as well as groups (Myron Marston)
130
+ * support multiple formatters, each with their own output
131
+ * show exception classes in failure messages unless they come from RSpec
132
+ matchers or message expectations
133
+ * before(:all) { pending } sets all examples to pending
134
+
135
+ * Bug fixes
136
+ * fix bug due to change in behavior of reject in Ruby 1.9.3-dev (Shota Fukumori)
137
+ * fix bug when running in jruby: be explicit about passing block to super
138
+ (John Firebaugh)
139
+ * rake task doesn't choke on paths with quotes (Janmejay Singh)
140
+ * restore --options option from rspec-1
141
+ * require 'ostruct' to fix bug with its([key]) (Kim Burgestrand)
142
+ * --configure option generates .rspec file instead of autotest/discover.rb
143
+
144
+ ### 2.3.1 / 2010-12-16
145
+
146
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.3.0...v2.3.1)
147
+
148
+ * Bug fixes
149
+ * send debugger warning message to $stdout if RSpec.configuration.error_stream
150
+ has not been defined yet.
151
+ * HTML Formatter _finally_ properly displays nested groups (Jarmo Pertman)
152
+ * eliminate some warnings when running RSpec's own suite (Jarmo Pertman)
153
+
154
+ ### 2.3.0 / 2010-12-12
155
+
156
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.2.1...v2.3.0)
157
+
158
+ * Enhancements
159
+ * tell autotest to use "rspec2" if it sees a .rspec file in the project's
160
+ root directory
161
+ * replaces the need for ./autotest/discover.rb, which will not work with
162
+ all versions of ZenTest and/or autotest
163
+ * config.expect_with
164
+ * :rspec # => rspec/expectations
165
+ * :stdlib # => test/unit/assertions
166
+ * :rspec, :stdlib # => both
167
+
168
+ * Bug fixes
169
+ * fix dev Gemfile to work on non-mac-os machines (Lake Denman)
170
+ * ensure explicit subject is only eval'd once (Laszlo Bacsi)
171
+
172
+ ### 2.2.1 / 2010-11-28
173
+
174
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.2.0...v2.2.1)
175
+
176
+ * Bug fixes
177
+ * alias_method instead of override Kernel#method_missing (John Wilger)
178
+ * changed --autotest to --tty in generated command (MIKAMI Yoshiyuki)
179
+ * revert change to debugger (had introduced conflict with Rails)
180
+ * also restored --debugger/-debug option
181
+
182
+ ### 2.2.0 / 2010-11-28
183
+
184
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.1.0...v2.2.0)
185
+
186
+ * Deprecations/changes
187
+ * --debug/-d on command line is deprecated and now has no effect
188
+ * win32console is now ignored; Windows users must use ANSICON for color support
189
+ (Bosko Ivanisevic)
190
+
191
+ * Enhancements
192
+ * When developing locally rspec-core now works with the rspec-dev setup or your local gems
193
+ * Raise exception with helpful message when rspec-1 is loaded alongside
194
+ rspec-2 (Justin Ko)
195
+ * debugger statements _just work_ as long as ruby-debug is installed
196
+ * otherwise you get warned, but not fired
197
+ * Expose example.metadata in around hooks
198
+ * Performance improvments (much faster now)
199
+
200
+ * Bug fixes
201
+ * Make sure --fail-fast makes it across drb
202
+ * Pass -Ilib:spec to rcov
203
+
204
+ ### 2.1.0 / 2010-11-07
205
+
206
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.1...v2.1.0)
207
+
208
+ * Enhancments
209
+ * Add skip_bundler option to rake task to tell rake task to ignore the
210
+ presence of a Gemfile (jfelchner)
211
+ * Add gemfile option to rake task to tell rake task what Gemfile to look
212
+ for (defaults to 'Gemfile')
213
+ * Allow passing caller trace into Metadata to support extensions (Glenn
214
+ Vanderburg)
215
+ * Add deprecation warning for Spec::Runner.configure to aid upgrade from
216
+ RSpec-1
217
+ * Add deprecated Spec::Rake::SpecTask to aid upgrade from RSpec-1
218
+ * Add 'autospec' command with helpful message to aid upgrade from RSpec-1
219
+ * Add support for filtering with tags on CLI (Lailson Bandeira)
220
+ * Add a helpful message about RUBYOPT when require fails in bin/rspec
221
+ (slyphon)
222
+ * Add "-Ilib" to the default rcov options (Tianyi Cui)
223
+ * Make the expectation framework configurable (default rspec, of course)
224
+ (Justin Ko)
225
+ * Add 'pending' to be conditional (Myron Marston)
226
+ * Add explicit support for :if and :unless as metadata keys for conditional run
227
+ of examples (Myron Marston)
228
+ * Add --fail-fast command line option (Jeff Kreeftmeijer)
229
+
230
+ * Bug fixes
231
+ * Eliminate stack overflow with "subject { self }"
232
+ * Require 'rspec/core' in the Raketask (ensures it required when running rcov)
233
+
234
+ ### 2.0.1 / 2010-10-18
235
+
236
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0...v2.0.1)
237
+
238
+ * Bug fixes
239
+ * Restore color when using spork + autotest
240
+ * Pending examples without docstrings render the correct message (Josep M. Bach)
241
+ * Fixed bug where a failure in a spec file ending in anything but _spec.rb would
242
+ fail in a confusing way.
243
+ * Support backtrace lines from erb templates in html formatter (Alex Crichton)
244
+
245
+ ### 2.0.0 / 2010-10-10
246
+
247
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0.rc...v2.0.0)
248
+
249
+ * RSpec-1 compatibility
250
+ * Rake task uses ENV["SPEC"] as file list if present
251
+
252
+ * Bug fixes
253
+ * Bug Fix: optparse --out foo.txt (Leonardo Bessa)
254
+ * Suppress color codes for non-tty output (except autotest)
255
+
256
+ ### 2.0.0.rc / 2010-10-05
257
+
258
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0.beta.22...v2.0.0.rc)
259
+
260
+ * Enhancements
261
+ * implicitly require unknown formatters so you don't have to require the
262
+ file explicitly on the commmand line (Michael Grosser)
263
+ * add --out/-o option to assign output target
264
+ * added fail_fast configuration option to abort on first failure
265
+ * support a Hash subject (its([:key]) { should == value }) (Josep M. Bach)
266
+
267
+ * Bug fixes
268
+ * Explicitly require rspec version to fix broken rdoc task (Hans de Graaff)
269
+ * Ignore backtrace lines that come from other languages, like Java or
270
+ Javascript (Charles Lowell)
271
+ * Rake task now does what is expected when setting (or not setting)
272
+ fail_on_error and verbose
273
+ * Fix bug in which before/after(:all) hooks were running on excluded nested
274
+ groups (Myron Marston)
275
+ * Fix before(:all) error handling so that it fails examples in nested groups,
276
+ too (Myron Marston)
277
+
278
+ ### 2.0.0.beta.22 / 2010-09-12
279
+
280
+ [full changelog](http://github.com/rspec/rspec-core/compare/v2.0.0.beta.20...v2.0.0.beta.22)
281
+
282
+ * Enhancements
283
+ * removed at_exit hook
284
+ * CTRL-C stops the run (almost) immediately
285
+ * first it cleans things up by running the appropriate after(:all) and after(:suite) hooks
286
+ * then it reports on any examples that have already run
287
+ * cleaned up rake task
288
+ * generate correct task under variety of conditions
289
+ * options are more consistent
290
+ * deprecated redundant options
291
+ * run 'bundle exec autotest' when Gemfile is present
292
+ * support ERB in .rspec options files (Justin Ko)
293
+ * depend on bundler for development tasks (Myron Marston)
294
+ * add example_group_finished to formatters and reporter (Roman Chernyatchik)
295
+
296
+ * Bug fixes
297
+ * support paths with spaces when using autotest (Andreas Neuhaus)
298
+ * fix module_exec with ruby 1.8.6 (Myron Marston)
299
+ * remove context method from top-level
300
+ * was conflicting with irb, for example
301
+ * errors in before(:all) are now reported correctly (Chad Humphries)
302
+
303
+ * Removals
304
+ * removed -o --options-file command line option
305
+ * use ./.rspec and ~/.rspec
data/Gemfile CHANGED
@@ -1,24 +1,49 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "rake"
4
- gem "cucumber"
5
- gem "aruba", ">= 0.2.0"
6
- gem "autotest"
7
- gem "watchr"
8
- gem "rcov"
9
- gem "mocha"
10
- gem "rr"
11
- gem "flexmock"
12
- gem "nokogiri"
13
- gem "syntax"
14
- gem "rspec-core", :path => "."
15
- gem "rspec-expectations", :path => "../rspec-expectations"
16
- gem "rspec-mocks", :path => "../rspec-mocks"
17
- unless RUBY_PLATFORM == "java"
18
- case RUBY_VERSION
19
- when /^1.9.2/
20
- gem "ruby-debug19"
21
- when /^1.8/
22
- gem "ruby-debug"
3
+ ### rspec libs
4
+ %w[rspec rspec-core rspec-expectations rspec-mocks].each do |lib|
5
+ library_path = File.expand_path("../../#{lib}", __FILE__)
6
+ if File.exist?(library_path)
7
+ gem lib, :path => library_path
8
+ else
9
+ gem lib, :git => "git://github.com/rspec/#{lib}.git"
23
10
  end
24
11
  end
12
+
13
+ ### dev dependencies
14
+ gem "rake", "~> 0.9"
15
+ gem "cucumber", "~> 0.10.2"
16
+ gem "aruba", "~> 0.3.6"
17
+ gem "rcov", "0.9.9", :platforms => :mri
18
+ gem "relish", "0.2.0"
19
+ gem "guard-rspec", "0.1.9"
20
+ gem "growl", "1.0.3"
21
+ gem "ZenTest", "~> 4.4.2"
22
+ gem "nokogiri", "1.4.4"
23
+
24
+ platforms :mri_18 do
25
+ gem 'ruby-debug'
26
+ end
27
+
28
+ platforms :mri_19 do
29
+ gem 'linecache19', '0.5.11' # 0.5.12 cannot install on 1.9.1, and 0.5.11 appears to work with both 1.9.1 & 1.9.2
30
+ gem 'ruby-debug19'
31
+ gem 'ruby-debug-base19', RUBY_VERSION == '1.9.1' ? '0.11.23' : '~> 0.11.24'
32
+ end
33
+
34
+ platforms :mri_18, :mri_19 do
35
+ gem "rb-fsevent", "~> 0.3.9"
36
+ gem "ruby-prof", "~> 0.9.2"
37
+ end
38
+
39
+ platforms :jruby do
40
+ gem "jruby-openssl"
41
+ end
42
+
43
+ ### rspec-core only
44
+ gem "mocha", "~> 0.9.10"
45
+ gem "rr", "~> 1.0.2"
46
+ gem "flexmock", "0.8.8"
47
+
48
+ ### optional runtime deps
49
+ gem "syntax", "1.0.0"
data/Guardfile ADDED
@@ -0,0 +1,5 @@
1
+ guard 'rspec', :version => 2 do
2
+ watch(/^spec\/(.*)_spec.rb/)
3
+ watch(/^lib\/(.*)\.rb/) { |m| "spec/#{m[1]}_spec.rb" }
4
+ watch(/^spec\/spec_helper.rb/) { "spec" }
5
+ end
data/License.txt CHANGED
@@ -1,6 +1,7 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2009 David Chelimsky, Chad Humphries
3
+ Copyright (c) 2009 Chad Humphries, David Chelimsky
4
+ Copyright (c) 2005 The RSpec Development Team
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining
6
7
  a copy of this software and associated documentation files (the
@@ -1,14 +1,32 @@
1
1
  # RSpec Core
2
2
 
3
- Behaviour Driven Development for Ruby
3
+ RSpec Core provides the structure for writing executable examples of how your
4
+ code should behave.
4
5
 
5
- ## Upgrading from rspec-1.x
6
+ [![build status](http://travis-ci.org/rspec/rspec-core.png)](http://travis-ci.org/rspec/rspec-core)
7
+
8
+ ## Documentation
9
+
10
+ The [Cucumber features](http://relishapp.com/rspec/rspec-core) are the
11
+ most comprehensive and up-to-date docs for end-users.
6
12
 
7
- See [Upgrade.markdown](http://github.com/rspec/rspec-core/blob/master/Upgrade.markdown)
13
+ The [RDoc](http://rubydoc.info/gems/rspec-core/2.3.0/frames) provides
14
+ additional information for contributors and/or extenders.
15
+
16
+ All of the documentation is open source and a work in progress. If you find it
17
+ lacking or confusing, you can help improve it by submitting requests and
18
+ patches to the [rspec-core issue
19
+ tracker](https://github.com/rspec/rspec-core/issues).
8
20
 
9
21
  ## Install
10
22
 
11
- gem install rspec --prerelease
23
+ gem install rspec # for rspec-core, rspec-expectations, rspec-mocks
24
+ gem install rspec-core # for rspec-core only
25
+
26
+ ## Upgrading from rspec-1.x
27
+
28
+ See [features/Upgrade.md](http://github.com/rspec/rspec-core/blob/master/features/Upgrade.md)
29
+
12
30
 
13
31
  This will install the rspec, rspec-core, rspec-expectations and rspec-mocks
14
32
  gems.
@@ -47,7 +65,7 @@ Be sure to require the implementation file in the spec:
47
65
  require "calculator"
48
66
 
49
67
  Now run the spec again, and watch it pass:
50
-
68
+
51
69
  $ rspec spec/calculator_spec.rb
52
70
  .
53
71
 
data/Rakefile CHANGED
@@ -2,55 +2,86 @@ require "bundler"
2
2
  Bundler.setup
3
3
  Bundler::GemHelper.install_tasks
4
4
 
5
+ task :build => :raise_if_psych_is_defined
6
+
7
+ task :raise_if_psych_is_defined do
8
+ if defined?(Psych)
9
+ raise <<-MSG
10
+ ===============================================================================
11
+ Gems compiled in Ruby environments with Psych loaded are incompatible with Ruby
12
+ environments that don't have Psych loaded. Try building this gem in Ruby 1.8.7
13
+ instead.
14
+ ===============================================================================
15
+ MSG
16
+ end
17
+ end
18
+
5
19
  require "rake"
6
20
  require "yaml"
7
21
 
8
22
  require "rake/rdoctask"
9
23
  require "rspec/core/rake_task"
10
- require "cucumber/rake/task"
24
+ require "rspec/core/version"
11
25
 
12
- RSpec::Core::RakeTask.new(:spec)
26
+ begin
27
+ require "cucumber/rake/task"
28
+ Cucumber::Rake::Task.new(:cucumber)
29
+ rescue LoadError => e
30
+ puts "unable to load cucumber, some tasks unavailable"
31
+ task :cucumber do
32
+ # no-op
33
+ end
34
+ end
13
35
 
14
- desc "Run all examples using rcov"
15
- RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
16
- t.rcov = true
17
- t.rcov_opts = %[-Ilib -Ispec --exclude "mocks,expectations,gems/*,spec/resources,spec/lib,spec/spec_helper.rb,db/*,/Library/Ruby/*,config/*"]
18
- t.rcov_opts << %[--no-html --aggregate coverage.data]
36
+ desc "Run all examples"
37
+ RSpec::Core::RakeTask.new(:spec) do |t|
38
+ t.rspec_path = 'bin/rspec'
39
+ t.rspec_opts = %w[--color]
40
+ t.verbose = false
19
41
  end
20
42
 
21
- task :cleanup_rcov_files do
22
- rm_rf 'coverage.data'
43
+ namespace :rcov do
44
+ task :cleanup do
45
+ rm_rf 'coverage.data'
46
+ end
47
+
48
+ RSpec::Core::RakeTask.new :spec do |t|
49
+ t.rcov = true
50
+ t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
51
+ t.rcov_opts << %[--no-html --aggregate coverage.data]
52
+ end
53
+
54
+ if defined?(Cucumber)
55
+ Cucumber::Rake::Task.new :cucumber do |t|
56
+ t.cucumber_opts = %w{--format progress}
57
+ t.rcov = true
58
+ t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
59
+ t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data]
60
+ end
61
+ else
62
+ task :cucumber do
63
+ # no-op
64
+ end
65
+ end
66
+
23
67
  end
24
68
 
69
+ task :rcov => ["rcov:cleanup", "rcov:spec", "rcov:cucumber"]
70
+
71
+ task :default => [:spec, :cucumber]
72
+
25
73
  task :clobber do
26
74
  rm_rf 'pkg'
27
75
  rm_rf 'tmp'
28
76
  rm_rf 'coverage'
29
77
  end
30
78
 
31
- class Cucumber::Rake::Task::ForkedCucumberRunner
32
- # When cucumber shells out, we still need it to run in the context of our
33
- # bundle.
34
- def run
35
- sh "bundle exec #{RUBY} " + args.join(" ")
36
- end
37
- end
38
-
39
- if RUBY_VERSION.to_f >= 1.9
40
- Cucumber::Rake::Task.new(:cucumber) do |t|
41
- t.cucumber_opts = %w{--format progress}
42
- end
43
-
44
- task :default => [:spec, :cucumber]
45
- else
46
- Cucumber::Rake::Task.new(:cucumber) do |t|
47
- t.rcov = true
48
- t.rcov_opts = %[-Ilib -Ispec --exclude "mocks,expectations,gems/*,features,spec/ruby_forker,spec/rspec,spec/resources,spec/lib,spec/spec_helper.rb,db/*,/Library/Ruby/*,config/*"]
49
- t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data]
50
- t.cucumber_opts = %w{--format progress}
51
- end
52
-
53
- task :default => [:rcov, :cucumber]
79
+ desc "Push docs/cukes to relishapp using the relish-client-gem"
80
+ task :relish, :version do |t, args|
81
+ raise "rake relish[VERSION]" unless args[:version]
82
+ sh "cp Changelog.md features/"
83
+ sh "relish push rspec/rspec-core:#{args[:version]}"
84
+ sh "rm features/Changelog.md"
54
85
  end
55
86
 
56
87
  Rake::RDocTask.new do |rdoc|
data/bin/autospec ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rspec/core/deprecation'
3
+ RSpec.warn_deprecation <<-WARNING
4
+ ************************************************************
5
+ REMOVAL NOTICE: you are using behaviour that has been
6
+ removed from rspec-2.
7
+
8
+ * The 'autospec' command is no longer supported.
9
+ * Please use 'autotest' insted.
10
+
11
+ This message will be removed from a future version of rspec.
12
+ ************************************************************
13
+ WARNING
data/bin/rspec CHANGED
@@ -1,3 +1,25 @@
1
1
  #!/usr/bin/env ruby
2
- require 'rspec/core'
3
- exit RSpec::Core::Runner.run(ARGV, $stderr, $stdout)
2
+
3
+ begin
4
+ require 'rspec/autorun'
5
+ rescue LoadError
6
+ $stderr.puts <<-EOS
7
+ #{'*'*50}
8
+ Could not find 'rspec/autorun'
9
+
10
+ This may happen if you're using rubygems as your package manager, but it is not
11
+ being required through some mechanism before executing the rspec command.
12
+
13
+ You may need to do one of the following in your shell:
14
+
15
+ # for bash/zsh
16
+ export RUBYOPT=rubygems
17
+
18
+ # for csh, etc.
19
+ set RUBYOPT=rubygems
20
+
21
+ For background, please see http://gist.github.com/54177.
22
+ #{'*'*50}
23
+ EOS
24
+ exit(1)
25
+ end
data/cucumber.yml CHANGED
@@ -1,2 +1,2 @@
1
- default: --require features --strict --format progress --tags ~@wip features
1
+ default: --require features --strict --format progress --tags ~@wip<%= RUBY_PLATFORM == 'java' ? ' --tags ~@no-jruby' : '' %> features
2
2
  wip: --require features --tags @wip:3 --wip features
data/features/.nav ADDED
@@ -0,0 +1,57 @@
1
+ - Upgrade.md
2
+ - Changelog.md
3
+ - Autotest.md
4
+ - example_groups:
5
+ - basic_structure.feature
6
+ - shared_example_group.feature
7
+ - shared_context.feature
8
+ - command_line:
9
+ - configure.feature
10
+ - example_name_option.feature
11
+ - format_option.feature
12
+ - line_number_option.feature
13
+ - tag.feature
14
+ - line_number_appended_to_path.feature
15
+ - exit_status.feature
16
+ - rake_task.feature
17
+ - pending:
18
+ - pending_examples.feature
19
+ - hooks:
20
+ - before_and_after_hooks.feature
21
+ - around_hooks.feature
22
+ - filtering.feature
23
+ - subject:
24
+ - implicit_subject.feature
25
+ - explicit_subject.feature
26
+ - attribute_of_subject.feature
27
+ - implicit_receiver.feature
28
+ - helper_methods:
29
+ - let.feature
30
+ - arbitrary_methods.feature
31
+ - modules.feature
32
+ - metadata:
33
+ - current_example.feature
34
+ - described_class.feature
35
+ - user_defined.feature
36
+ - filtering:
37
+ - inclusion_filters.feature
38
+ - exclusion_filters.feature
39
+ - if_and_unless.feature
40
+ - run_all_when_everything_filtered.feature
41
+ - configuration:
42
+ - read_options_from_file.feature
43
+ - fail_fast.feature
44
+ - custom_settings.feature
45
+ - alias_example_to.feature
46
+ - expectation_framework_integration:
47
+ - configure_expectation_framework.feature
48
+ - mock_framework_integration:
49
+ - use_rspec.feature
50
+ - use_flexmock.feature
51
+ - use_mocha.feature
52
+ - use_rr.feature
53
+ - use_any_framework.feature
54
+ - formatters:
55
+ - custom_formatter.feature
56
+ - spec_files:
57
+ - arbitrary_file_suffix.feature