rspec 1.2.2 → 1.2.3

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 (138) hide show
  1. data/History.rdoc +31 -1
  2. data/Manifest.txt +14 -12
  3. data/Rakefile +1 -1
  4. data/Upgrade.rdoc +43 -3
  5. data/examples/failing/failing_implicit_docstrings_example.rb +5 -5
  6. data/examples/passing/implicit_docstrings_example.rb +3 -3
  7. data/features/before_and_after_blocks/before_and_after_blocks.feature +20 -21
  8. data/features/example_groups/example_group_with_should_methods.feature +20 -8
  9. data/features/example_groups/implicit_docstrings.feature +36 -20
  10. data/features/example_groups/nested_groups.feature +25 -10
  11. data/features/extensions/custom_example_group.feature +19 -0
  12. data/features/formatters/custom_formatter.feature +30 -0
  13. data/features/heckle/heckle.feature +7 -7
  14. data/features/interop/examples_and_tests_together.feature +63 -14
  15. data/features/interop/rspec_output.feature +25 -0
  16. data/features/interop/test_but_not_test_unit.feature +19 -7
  17. data/features/interop/test_case_with_should_methods.feature +37 -8
  18. data/features/matchers/{create_matcher.feature → define_matcher.feature} +54 -30
  19. data/features/matchers/{create_matcher_outside_rspec.feature → define_matcher_outside_rspec.feature} +7 -7
  20. data/features/mock_framework_integration/use_flexmock.feature +3 -3
  21. data/features/mock_framework_integration/use_mocha.feature +3 -3
  22. data/features/mock_framework_integration/use_rr.feature +3 -3
  23. data/features/mocks/mix_stubs_and_mocks.feature +4 -4
  24. data/features/pending/pending_examples.feature +18 -18
  25. data/features/runner/specify_line_number.feature +32 -0
  26. data/features/step_definitions/running_rspec_steps.rb +41 -0
  27. data/features/subject/explicit_subject.feature +4 -4
  28. data/features/subject/implicit_subject.feature +4 -4
  29. data/features/support/env.rb +64 -11
  30. data/features/support/matchers/smart_match.rb +10 -35
  31. data/lib/spec.rb +1 -0
  32. data/lib/spec/deprecation.rb +40 -0
  33. data/lib/spec/dsl/main.rb +10 -5
  34. data/lib/spec/example.rb +1 -27
  35. data/lib/spec/example/args_and_options.rb +27 -0
  36. data/lib/spec/example/before_and_after_hooks.rb +30 -21
  37. data/lib/spec/example/errors.rb +8 -18
  38. data/lib/spec/example/example_group_factory.rb +0 -4
  39. data/lib/spec/example/example_group_methods.rb +27 -41
  40. data/lib/spec/example/example_group_proxy.rb +12 -22
  41. data/lib/spec/example/example_methods.rb +8 -18
  42. data/lib/spec/example/example_proxy.rb +4 -4
  43. data/lib/spec/example/pending.rb +3 -4
  44. data/lib/spec/example/predicate_matchers.rb +1 -1
  45. data/lib/spec/example/subject.rb +2 -0
  46. data/lib/spec/expectations.rb +1 -26
  47. data/lib/spec/expectations/extensions.rb +1 -1
  48. data/lib/spec/expectations/extensions/kernel.rb +52 -0
  49. data/lib/spec/expectations/handler.rb +21 -10
  50. data/lib/spec/matchers/be.rb +3 -3
  51. data/lib/spec/matchers/be_close.rb +17 -21
  52. data/lib/spec/matchers/be_instance_of.rb +7 -26
  53. data/lib/spec/matchers/be_kind_of.rb +7 -26
  54. data/lib/spec/matchers/dsl.rb +9 -4
  55. data/lib/spec/matchers/eql.rb +24 -25
  56. data/lib/spec/matchers/equal.rb +25 -25
  57. data/lib/spec/matchers/exist.rb +5 -21
  58. data/lib/spec/matchers/include.rb +22 -44
  59. data/lib/spec/matchers/match.rb +5 -25
  60. data/lib/spec/matchers/match_array.rb +8 -4
  61. data/lib/spec/matchers/matcher.rb +13 -2
  62. data/lib/spec/matchers/pretty.rb +1 -0
  63. data/lib/spec/matchers/simple_matcher.rb +2 -2
  64. data/lib/spec/mocks/mock.rb +10 -10
  65. data/lib/spec/mocks/spec_methods.rb +1 -1
  66. data/lib/spec/runner/configuration.rb +53 -42
  67. data/lib/spec/{expectations → runner}/differs/default.rb +0 -0
  68. data/lib/spec/{expectations → runner}/differs/load-diff-lcs.rb +0 -0
  69. data/lib/spec/runner/drb_command_line.rb +1 -1
  70. data/lib/spec/runner/example_group_runner.rb +0 -12
  71. data/lib/spec/runner/formatter/base_formatter.rb +77 -30
  72. data/lib/spec/runner/formatter/base_text_formatter.rb +19 -24
  73. data/lib/spec/runner/formatter/failing_example_groups_formatter.rb +1 -1
  74. data/lib/spec/runner/formatter/html_formatter.rb +4 -6
  75. data/lib/spec/runner/formatter/nested_text_formatter.rb +2 -2
  76. data/lib/spec/runner/formatter/no_op_method_missing.rb +21 -0
  77. data/lib/spec/runner/formatter/profile_formatter.rb +0 -4
  78. data/lib/spec/runner/formatter/progress_bar_formatter.rb +4 -5
  79. data/lib/spec/runner/formatter/silent_formatter.rb +10 -0
  80. data/lib/spec/runner/formatter/specdoc_formatter.rb +2 -2
  81. data/lib/spec/runner/option_parser.rb +14 -7
  82. data/lib/spec/runner/options.rb +17 -7
  83. data/lib/spec/runner/reporter.rb +69 -64
  84. data/lib/spec/version.rb +1 -1
  85. data/spec/spec/dsl/main_spec.rb +7 -0
  86. data/spec/spec/example/example_group_methods_spec.rb +16 -32
  87. data/spec/spec/example/example_group_proxy_spec.rb +25 -5
  88. data/spec/spec/example/example_group_spec.rb +2 -2
  89. data/spec/spec/example/example_methods_spec.rb +19 -24
  90. data/spec/spec/example/example_proxy_spec.rb +11 -1
  91. data/spec/spec/example/pending_module_spec.rb +2 -108
  92. data/spec/spec/example/predicate_matcher_spec.rb +23 -3
  93. data/spec/spec/expectations/extensions/object_spec.rb +9 -9
  94. data/spec/spec/expectations/fail_with_spec.rb +13 -13
  95. data/spec/spec/expectations/handler_spec.rb +44 -15
  96. data/spec/spec/matchers/be_close_spec.rb +9 -0
  97. data/spec/spec/matchers/be_instance_of_spec.rb +6 -4
  98. data/spec/spec/matchers/be_kind_of_spec.rb +5 -3
  99. data/spec/spec/matchers/be_spec.rb +1 -5
  100. data/spec/spec/matchers/compatibility_spec.rb +1 -1
  101. data/spec/spec/matchers/dsl_spec.rb +10 -1
  102. data/spec/spec/matchers/eql_spec.rb +8 -4
  103. data/spec/spec/matchers/equal_spec.rb +8 -4
  104. data/spec/spec/matchers/exist_spec.rb +1 -1
  105. data/spec/spec/matchers/include_spec.rb +1 -1
  106. data/spec/spec/matchers/match_array_spec.rb +26 -1
  107. data/spec/spec/matchers/match_spec.rb +2 -2
  108. data/spec/spec/matchers/matcher_methods_spec.rb +0 -3
  109. data/spec/spec/matchers/matcher_spec.rb +53 -0
  110. data/spec/spec/matchers/operator_matcher_spec.rb +1 -1
  111. data/spec/spec/mocks/mock_spec.rb +6 -0
  112. data/spec/spec/runner/configuration_spec.rb +11 -1
  113. data/spec/spec/runner/drb_command_line_spec.rb +13 -1
  114. data/spec/spec/runner/example_group_runner_spec.rb +0 -7
  115. data/spec/spec/runner/formatter/base_formatter_spec.rb +19 -12
  116. data/spec/spec/runner/formatter/base_text_formatter_spec.rb +2 -2
  117. data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +4 -4
  118. data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +2 -2
  119. data/spec/spec/runner/formatter/html_formatted-1.8.6.html +31 -34
  120. data/spec/spec/runner/formatter/html_formatter_spec.rb +20 -0
  121. data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +20 -20
  122. data/spec/spec/runner/formatter/profile_formatter_spec.rb +22 -3
  123. data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +24 -3
  124. data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +6 -6
  125. data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +25 -28
  126. data/spec/spec/runner/formatter/text_mate_formatter_spec.rb +2 -2
  127. data/spec/spec/runner/option_parser_spec.rb +108 -40
  128. data/spec/spec/runner/reporter_spec.rb +16 -17
  129. data/spec/spec_helper.rb +4 -1
  130. metadata +20 -18
  131. data/features/example_groups/output.feature +0 -20
  132. data/features/step_definitions/running_rspec.rb +0 -69
  133. data/lib/spec/expectations/extensions/object.rb +0 -63
  134. data/resources/spec/example_group_with_should_methods.rb +0 -12
  135. data/resources/spec/simple_spec.rb +0 -8
  136. data/resources/test/spec_and_test_together.rb +0 -56
  137. data/resources/test/spec_including_test_but_not_unit.rb +0 -11
  138. data/resources/test/test_case_with_should_methods.rb +0 -29
@@ -32,7 +32,7 @@ module Spec
32
32
  parent_example_group = Class.new(::Spec::Example::ExampleGroupDouble).describe('Parent')
33
33
  child_example_group = Class.new(parent_example_group).describe('Child')
34
34
 
35
- formatter.add_example_group(Spec::Example::ExampleGroupProxy.new(child_example_group))
35
+ formatter.example_group_started(Spec::Example::ExampleGroupProxy.new(child_example_group))
36
36
 
37
37
  formatter.example_started('when foo')
38
38
  Time.stub!(:now).and_return(now+1)
@@ -50,7 +50,7 @@ module Spec
50
50
 
51
51
  it "should print the top 10 results" do
52
52
  example_group = Class.new(::Spec::Example::ExampleGroup).describe("ExampleGroup")
53
- formatter.add_example_group(Spec::Example::ExampleGroupProxy.new(example_group))
53
+ formatter.example_group_started(Spec::Example::ExampleGroupProxy.new(example_group))
54
54
  formatter.instance_variable_set("@time", Time.now)
55
55
 
56
56
  15.times do
@@ -60,7 +60,26 @@ module Spec
60
60
  io.should_receive(:print).exactly(10)
61
61
  formatter.start_dump
62
62
  end
63
+
64
+ it "should have method_missing as private" do
65
+ ProfileFormatter.private_instance_methods.should include("method_missing")
66
+ end
67
+
68
+ it "should respond_to? all messages" do
69
+ formatter = ProfileFormatter.new({ }, StringIO.new)
70
+ formatter.should respond_to(:just_about_anything)
71
+ end
72
+
73
+ it "should respond_to? anything, when given the private flag" do
74
+ formatter = ProfileFormatter.new({ }, StringIO.new)
75
+ formatter.respond_to?(:method_missing, true).should be_true
76
+ end
77
+
78
+ it "should not respond_to? method_missing (because it's private)" do
79
+ formatter = ProfileFormatter.new({ }, StringIO.new)
80
+ formatter.respond_to?(:method_missing).should be_false
81
+ end
63
82
  end
64
83
  end
65
84
  end
66
- end
85
+ end
@@ -30,7 +30,7 @@ module Spec
30
30
  end
31
31
  end
32
32
  example = example_group.examples.first
33
- @formatter.add_example_group(Spec::Example::ExampleGroupProxy.new(example_group))
33
+ @formatter.example_group_started(Spec::Example::ExampleGroupProxy.new(example_group))
34
34
  @formatter.example_pending(example, "message", "#{__FILE__}:#{__LINE__}")
35
35
  @io.rewind
36
36
  @formatter.dump_summary(3, 2, 1, 1)
@@ -97,8 +97,8 @@ EOE
97
97
  end
98
98
  example = example_group.examples.first
99
99
  file = __FILE__
100
- line = __LINE__ + 2
101
- @formatter.add_example_group(Spec::Example::ExampleGroupProxy.new(example_group))
100
+ line = __LINE__ - 5
101
+ @formatter.example_group_started(Spec::Example::ExampleGroupProxy.new(example_group))
102
102
  @formatter.example_pending(example, "message", "#{__FILE__}:#{__LINE__}")
103
103
  @formatter.dump_pending
104
104
  @io.string.should ==(<<-HERE)
@@ -143,6 +143,27 @@ HERE
143
143
  @io.string.should eql("")
144
144
  end
145
145
  end
146
+
147
+ describe ProgressBarFormatter, "method_missing" do
148
+ it "should have method_missing as private" do
149
+ ProgressBarFormatter.private_instance_methods.should include("method_missing")
150
+ end
151
+
152
+ it "should respond_to? all messages" do
153
+ formatter = ProgressBarFormatter.new({ }, StringIO.new)
154
+ formatter.should respond_to(:just_about_anything)
155
+ end
156
+
157
+ it "should respond_to? anything, when given the private flag" do
158
+ formatter = ProgressBarFormatter.new({ }, StringIO.new)
159
+ formatter.respond_to?(:method_missing, true).should be_true
160
+ end
161
+
162
+ it "should not respond_to? method_missing (because it's private)" do
163
+ formatter = ProgressBarFormatter.new({ }, StringIO.new)
164
+ formatter.respond_to?(:method_missing).should be_false
165
+ end
166
+ end
146
167
  end
147
168
  end
148
169
  end
@@ -20,11 +20,11 @@ module Spec
20
20
 
21
21
  describe "where ExampleGroup has no superclasss with a description" do
22
22
  before do
23
- add_example_group
23
+ example_group_started
24
24
  end
25
25
 
26
- def add_example_group
27
- formatter.add_example_group(Spec::Example::ExampleGroupProxy.new(example_group))
26
+ def example_group_started
27
+ formatter.example_group_started(Spec::Example::ExampleGroupProxy.new(example_group))
28
28
  end
29
29
 
30
30
  describe "#dump_summary" do
@@ -39,7 +39,7 @@ module Spec
39
39
  end
40
40
  end
41
41
 
42
- describe "#add_example_group" do
42
+ describe "#example_group_started" do
43
43
  it "should push ExampleGroup name" do
44
44
  io.string.should eql("\nExampleGroup\n")
45
45
  end
@@ -73,10 +73,10 @@ module Spec
73
73
  describe "where ExampleGroup has two superclasses with a description" do
74
74
  attr_reader :child_example_group, :grand_child_example_group
75
75
 
76
- def add_example_group
76
+ def example_group_started
77
77
  @child_example_group = Class.new(example_group).describe("Child ExampleGroup")
78
78
  @grand_child_example_group = Class.new(child_example_group).describe("GrandChild ExampleGroup")
79
- formatter.add_example_group(Spec::Example::ExampleGroupProxy.new(grand_child_example_group))
79
+ formatter.example_group_started(Spec::Example::ExampleGroupProxy.new(grand_child_example_group))
80
80
  end
81
81
 
82
82
  describe "when having an error" do
@@ -192,9 +192,9 @@ a {
192
192
  <div class="failure" id="failure_1">
193
193
  <div class="message"><pre>Mock 'poke me' expected :poke with (any args) once, but received it 0 times</pre></div>
194
194
  <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb&line=13">./examples/failing/mocking_example.rb:13</a>
195
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:51</a>
196
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> :in `chdir'
197
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> </pre></div>
195
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=49">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:49</a>
196
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> :in `chdir'
197
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> </pre></div>
198
198
  <pre class="ruby"><code><span class="linenum">11</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">should fail when expected message not received</span><span class="punct">&quot;</span> <span class="keyword">do</span>
199
199
  <span class="linenum">12</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">(&quot;</span><span class="string">poke me</span><span class="punct">&quot;)</span>
200
200
  <span class="offending"><span class="linenum">13</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_receive</span><span class="punct">(</span><span class="symbol">:poke</span><span class="punct">)</span></span>
@@ -208,9 +208,9 @@ a {
208
208
  <div class="failure" id="failure_2">
209
209
  <div class="message"><pre>Mock 'one two three' received :three out of order</pre></div>
210
210
  <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb&line=22">./examples/failing/mocking_example.rb:22</a>
211
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:51</a>
212
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> :in `chdir'
213
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> </pre></div>
211
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=49">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:49</a>
212
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> :in `chdir'
213
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> </pre></div>
214
214
  <pre class="ruby"><code><span class="linenum">20</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_receive</span><span class="punct">(</span><span class="symbol">:three</span><span class="punct">).</span><span class="ident">ordered</span>
215
215
  <span class="linenum">21</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">one</span>
216
216
  <span class="offending"><span class="linenum">22</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">three</span></span>
@@ -224,9 +224,9 @@ a {
224
224
  <div class="failure" id="failure_3">
225
225
  <div class="message"><pre>Mock 'don't talk to me' expected :any_message_at_all with (no args) 0 times, but received it once</pre></div>
226
226
  <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb&line=29">./examples/failing/mocking_example.rb:29</a>
227
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:51</a>
228
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> :in `chdir'
229
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> </pre></div>
227
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=49">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:49</a>
228
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> :in `chdir'
229
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> </pre></div>
230
230
  <pre class="ruby"><code><span class="linenum">27</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">(&quot;</span><span class="string">don't talk to me</span><span class="punct">&quot;)</span>
231
231
  <span class="linenum">28</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_not_receive</span><span class="punct">(</span><span class="symbol">:any_message_at_all</span><span class="punct">)</span>
232
232
  <span class="offending"><span class="linenum">29</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">any_message_at_all</span></span>
@@ -239,9 +239,9 @@ a {
239
239
  <div class="failure" id="failure_4">
240
240
  <div class="message"><pre>Expected pending 'here is the bug' to fail. No Error was raised.</pre></div>
241
241
  <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb&line=33">./examples/failing/mocking_example.rb:33</a>
242
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:51</a>
243
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> :in `chdir'
244
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> </pre></div>
242
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=49">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:49</a>
243
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> :in `chdir'
244
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> </pre></div>
245
245
  <pre class="ruby"><code><span class="linenum">31</span>
246
246
  <span class="linenum">32</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">has a bug we need to fix</span><span class="punct">&quot;</span> <span class="keyword">do</span>
247
247
  <span class="offending"><span class="linenum">33</span> <span class="ident">pending</span> <span class="punct">&quot;</span><span class="string">here is the bug</span><span class="punct">&quot;</span> <span class="keyword">do</span></span>
@@ -269,9 +269,9 @@ Diff:
269
269
  framework for Ruby
270
270
  </pre></div>
271
271
  <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/diffing_spec.rb&line=13">./examples/failing/diffing_spec.rb:13</a>
272
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:51</a>
273
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> :in `chdir'
274
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> </pre></div>
272
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=49">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:49</a>
273
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> :in `chdir'
274
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> </pre></div>
275
275
  <pre class="ruby"><code><span class="linenum">11</span><span class="ident">framework</span> <span class="keyword">for</span> <span class="constant">Ruby</span>
276
276
  <span class="linenum">12</span><span class="constant">EOF</span>
277
277
  <span class="offending"><span class="linenum">13</span> <span class="ident">usa</span><span class="punct">.</span><span class="ident">should</span> <span class="punct">==</span> <span class="ident">uk</span></span>
@@ -282,27 +282,24 @@ Diff:
282
282
  <dd class="spec failed">
283
283
  <span class="failed_spec_name">should print diff of different objects' pretty representation</span>
284
284
  <div class="failure" id="failure_6">
285
- <div class="message"><pre>expected &lt;Animal
285
+ <div class="message"><pre>
286
+ expected &lt;Animal
286
287
  name=bob,
287
288
  species=tortoise
288
289
  &gt;
289
- , got &lt;Animal
290
+
291
+ got &lt;Animal
290
292
  name=bob,
291
293
  species=giraffe
292
294
  &gt;
293
- (using .eql?)
294
- Diff:
295
- @@ -1,5 +1,5 @@
296
- &lt;Animal
297
- name=bob,
298
- -species=tortoise
299
- +species=giraffe
300
- &gt;
295
+
296
+
297
+ (compared using eql?)
301
298
  </pre></div>
302
299
  <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/diffing_spec.rb&line=34">./examples/failing/diffing_spec.rb:34</a>
303
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:51</a>
304
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> :in `chdir'
305
- <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb:47</a> </pre></div>
300
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=49">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:49</a>
301
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> :in `chdir'
302
+ <a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatter_spec.rb&line=45">./spec/spec/runner/formatter/text_mate_formatter_spec.rb:45</a> </pre></div>
306
303
  <pre class="ruby"><code><span class="linenum">32</span> <span class="ident">expected</span> <span class="punct">=</span> <span class="constant">Animal</span><span class="punct">.</span><span class="ident">new</span> <span class="punct">&quot;</span><span class="string">bob</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">giraffe</span><span class="punct">&quot;</span>
307
304
  <span class="linenum">33</span> <span class="ident">actual</span> <span class="punct">=</span> <span class="constant">Animal</span><span class="punct">.</span><span class="ident">new</span> <span class="punct">&quot;</span><span class="string">bob</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">tortoise</span><span class="punct">&quot;</span>
308
305
  <span class="offending"><span class="linenum">34</span> <span class="ident">expected</span><span class="punct">.</span><span class="ident">should</span> <span class="ident">eql</span><span class="punct">(</span><span class="ident">actual</span><span class="punct">)</span></span>
@@ -49,10 +49,10 @@ module Spec
49
49
  # Spec::Runner::CommandLine.run(
50
50
  # ::Spec::Runner::OptionParser.parse(args, err, out)
51
51
  # )
52
- #
52
+ #
53
53
  # seconds = /\d+\.\d+ seconds/
54
54
  # html = out.string.gsub seconds, 'x seconds'
55
- #
55
+ #
56
56
  # File.open(expected_file, 'w') {|io| io.write(html)}
57
57
  # end
58
58
  # end
@@ -35,13 +35,15 @@ describe "OptionParser" do
35
35
  end
36
36
 
37
37
  it "should turn off the debugger option if drb is specified later" do
38
+ @parser.stub!(:parse_drb).with(no_args).and_return(true)
38
39
  options = parse(["-u", "--drb"])
39
- options.debug.should_not be_true
40
+ options.debug.should be_false
40
41
  end
41
42
 
42
43
  it "should turn off the debugger option if drb is specified first" do
44
+ @parser.stub!(:parse_drb).with(no_args).and_return(true)
43
45
  options = parse(["--drb", "-u"])
44
- options.debug.should_not be_true
46
+ options.debug.should be_false
45
47
  end
46
48
 
47
49
  it "should accept dry run option" do
@@ -81,7 +83,7 @@ describe "OptionParser" do
81
83
  Spec::Runner::OptionParser.stub!(:spec_command?).and_return(true)
82
84
  options = parse([])
83
85
  @out.rewind
84
- @out.read.should match(/Usage: spec \(FILE\|DIRECTORY\|GLOB\)\+ \[options\]/m)
86
+ @out.read.should match(/Usage: spec \(FILE\(:LINE\)\?\|DIRECTORY\|GLOB\)\+ \[options\]/m)
85
87
  end
86
88
 
87
89
  it "should not print help to stdout if no args and NOT spec_command?" do
@@ -94,7 +96,7 @@ describe "OptionParser" do
94
96
  it "should print help to stdout" do
95
97
  options = parse(["--help"])
96
98
  @out.rewind
97
- @out.read.should match(/Usage: spec \(FILE\|DIRECTORY\|GLOB\)\+ \[options\]/m)
99
+ @out.read.should match(/Usage: spec \(FILE\(:LINE\)\?\|DIRECTORY\|GLOB\)\+ \[options\]/m)
98
100
  end
99
101
 
100
102
  it "should print instructions about how to require missing formatter" do
@@ -169,14 +171,14 @@ describe "OptionParser" do
169
171
  options.formatters[0].class.should equal(Spec::Runner::Formatter::HtmlFormatter)
170
172
  end
171
173
 
172
- it "should use base formatter when format is s" do
174
+ it "should use silent formatter when format is s" do
173
175
  options = parse(["--format", "l"])
174
- options.formatters[0].class.should equal(Spec::Runner::Formatter::BaseFormatter)
176
+ options.formatters[0].class.should equal(Spec::Runner::Formatter::SilentFormatter)
175
177
  end
176
178
 
177
- it "should use base formatter when format is silent" do
179
+ it "should use silent formatter when format is silent" do
178
180
  options = parse(["--format", "silent"])
179
- options.formatters[0].class.should equal(Spec::Runner::Formatter::BaseFormatter)
181
+ options.formatters[0].class.should equal(Spec::Runner::Formatter::SilentFormatter)
180
182
  end
181
183
 
182
184
  it "should use html formatter with explicit output when format is html:test.html" do
@@ -279,40 +281,87 @@ describe "OptionParser" do
279
281
  options.filename_pattern = "*_fixture.rb"
280
282
  options
281
283
  end
282
-
283
- it "should support --line to identify spec" do
284
- options = parse([file, "--line", "13"])
285
- options.line_number.should == 13
286
- options.examples.should be_empty
287
- options.run_examples
288
- options.examples.should eql(["d"])
289
- end
290
-
291
- it "should fail with error message if file is dir along with --line" do
292
- options = parse([dir, "--line", "169"])
293
- options.line_number.should == 169
294
- options.run_examples
295
- @err.string.should match(/You must specify one file, not a directory when using the --line option/n)
296
- end
297
-
298
- it "should fail with error message if file does not exist along with --line" do
299
- options = parse(["some file", "--line", "169"])
300
- proc do
284
+
285
+ describe 'with the --line flag' do
286
+ it "should correctly identify the spec" do
287
+ options = parse([file, "--line", "13"])
288
+ options.line_number.should == 13
289
+ options.examples.should be_empty
301
290
  options.run_examples
302
- end.should raise_error
303
- end
304
-
305
- it "should fail with error message if more than one files are specified along with --line" do
306
- options = parse([file, file, "--line", "169"])
307
- options.run_examples
308
- @err.string.should match(/Only one file can be specified when using the --line option/n)
291
+ options.examples.should eql(["d"])
292
+ end
293
+
294
+ it "should fail with error message if specified file is a dir" do
295
+ options = parse([dir, "--line", "169"])
296
+ options.line_number.should == 169
297
+ options.run_examples
298
+ @err.string.should match(/You must specify one file, not a directory when providing a line number/n)
299
+ end
300
+
301
+
302
+ it "should fail with error message if file does not exist" do
303
+ options = parse(["some file", "--line", "169"])
304
+ proc do
305
+ options.run_examples
306
+ end.should raise_error
307
+ end
308
+
309
+ it "should fail with error message if more than one files are specified" do
310
+ options = parse([file, file, "--line", "169"])
311
+ options.run_examples
312
+ @err.string.should match(/Only one file can be specified when providing a line number/n)
313
+ end
314
+
315
+ it "should fail with error message if using simultaneously with --example" do
316
+ options = parse([file, "--example", "some example", "--line", "169"])
317
+ options.run_examples
318
+ @err.string.should match(/You cannot use --example and specify a line number/n)
319
+ end
309
320
  end
310
-
311
- it "should fail with error message if --example and --line are used simultaneously" do
312
- options = parse([file, "--example", "some example", "--line", "169"])
313
- options.run_examples
314
- @err.string.should match(/You cannot use both --line and --example/n)
321
+
322
+ describe 'with the colon syntax (filename:LINE_NUMBER)' do
323
+
324
+ it "should strip the line number from the file name" do
325
+ options = parse(["#{file}:13"])
326
+ options.files.should include(file)
327
+ end
328
+
329
+ it "should correctly identify the spec" do
330
+ options = parse(["#{file}:13"])
331
+ options.line_number.should == 13
332
+ options.examples.should be_empty
333
+ options.run_examples
334
+ options.examples.should eql(["d"])
335
+ end
336
+
337
+ it "should fail with error message if specified file is a dir" do
338
+ options = parse(["#{dir}:169"])
339
+ options.line_number.should == 169
340
+ options.run_examples
341
+ @err.string.should match(/You must specify one file, not a directory when providing a line number/n)
342
+ end
343
+
344
+
345
+ it "should fail with error message if file does not exist" do
346
+ options = parse(["some file:169"])
347
+ proc do
348
+ options.run_examples
349
+ end.should raise_error
350
+ end
351
+
352
+ it "should fail with error message if more than one files are specified" do
353
+ options = parse([file, "#{file}:169"])
354
+ options.run_examples
355
+ @err.string.should match(/Only one file can be specified when providing a line number/n)
356
+ end
357
+
358
+ it "should fail with error message if using simultaneously with --example" do
359
+ options = parse(["#{file}:169", "--example", "some example"])
360
+ options.run_examples
361
+ @err.string.should match(/You cannot use --example and specify a line number/n)
362
+ end
315
363
  end
364
+
316
365
  end
317
366
 
318
367
  if [/mswin/, /java/].detect{|p| p =~ RUBY_PLATFORM}
@@ -350,12 +399,31 @@ describe "OptionParser" do
350
399
  options = parse(["--options", File.dirname(__FILE__) + "/spec_drb.opts"])
351
400
  end
352
401
 
353
- it "should send all the arguments others than --drb back to the parser after parsing options" do
402
+ it "should send all the arguments other than --drb back to the parser after parsing options" do
354
403
  Spec::Runner::DrbCommandLine.should_receive(:run).and_return do |options|
355
404
  options.argv.should == ["example_file.rb", "--colour"]
356
405
  end
357
406
  options = parse(["example_file.rb", "--options", File.dirname(__FILE__) + "/spec_drb.opts"])
358
407
  end
408
+
409
+ it "runs specs locally if no drb is running when --drb is specified" do
410
+ Spec::Runner::DrbCommandLine.should_receive(:run).and_return(false)
411
+ options = parse(["example_file.rb", "--options", File.dirname(__FILE__) + "/spec_drb.opts"])
412
+ options.__send__(:examples_should_be_run?).should be_true
413
+ end
414
+
415
+ it "says its running specs locally if no drb is running when --drb is specified" do
416
+ Spec::Runner::DrbCommandLine.should_receive(:run).and_return(false)
417
+ options = parse(["example_file.rb", "--options", File.dirname(__FILE__) + "/spec_drb.opts"])
418
+ options.error_stream.rewind
419
+ options.error_stream.string.should =~ /Running specs locally/
420
+ end
421
+
422
+ it "does not run specs locally if drb is running when --drb is specified" do
423
+ Spec::Runner::DrbCommandLine.should_receive(:run).and_return(true)
424
+ options = parse(["example_file.rb", "--options", File.dirname(__FILE__) + "/spec_drb.opts"])
425
+ options.__send__(:examples_should_be_run?).should be_false
426
+ end
359
427
 
360
428
  it "should read spaced and multi-line options from file when --options is specified" do
361
429
  options = parse(["--options", File.dirname(__FILE__) + "/spec_spaced.opts"])
@@ -35,12 +35,12 @@ module Spec
35
35
  end
36
36
 
37
37
  it "should tell formatter when example_group is added" do
38
- formatter.should_receive(:add_example_group).with(example_group_proxy)
38
+ formatter.should_receive(:example_group_started).with(example_group_proxy)
39
39
  example_group.notify(reporter)
40
40
  end
41
41
 
42
42
  it "should handle multiple example_groups with same name" do
43
- formatter.should_receive(:add_example_group).exactly(3).times
43
+ formatter.should_receive(:example_group_started).exactly(3).times
44
44
  formatter.should_receive(:example_started).exactly(3).times
45
45
  formatter.should_receive(:example_passed).exactly(3).times
46
46
  formatter.should_receive(:start_dump)
@@ -68,11 +68,11 @@ module Spec
68
68
  passing = ::Spec::Example::ExampleGroupDouble.new(example_proxy)
69
69
  failing = ::Spec::Example::ExampleGroupDouble.new(example_proxy)
70
70
 
71
- formatter.should_receive(:add_example_group).exactly(2).times
71
+ formatter.should_receive(:example_group_started).exactly(2).times
72
72
  formatter.should_receive(:example_passed).with(description_of(passing)).exactly(2).times
73
73
  formatter.should_receive(:example_failed).with(description_of(failing), 1, failure)
74
74
  formatter.should_receive(:example_failed).with(description_of(failing), 2, failure)
75
- formatter.should_receive(:dump_failure).exactly(2).times
75
+ formatter.should_receive(:dump_failure).exactly(2).times
76
76
  formatter.should_receive(:start_dump)
77
77
  formatter.should_receive(:dump_pending)
78
78
  formatter.should_receive(:close).with(no_args)
@@ -163,38 +163,37 @@ module Spec
163
163
  describe "reporting one pending example (ExamplePendingError)" do
164
164
  before :each do
165
165
  @pending_error = Spec::Example::ExamplePendingError.new("reason")
166
- @pending_caller = @pending_error.pending_caller
167
166
  end
168
167
 
169
168
  it "should tell formatter example is pending" do
170
169
  example = ExampleGroup.new(example_proxy)
171
- formatter.should_receive(:example_pending).with(description_of(example), "reason", @pending_caller)
172
- formatter.should_receive(:add_example_group).with(example_group_proxy)
170
+ formatter.should_receive(:example_pending).with(description_of(example), "reason")
171
+ formatter.should_receive(:example_group_started).with(example_group_proxy)
173
172
  example_group.notify(reporter)
174
173
  reporter.example_finished(description_of(example), @pending_error)
175
174
  end
176
175
 
177
176
  it "should account for pending example in stats" do
178
177
  example = ExampleGroup.new(example_proxy)
179
- formatter.should_receive(:example_pending).with(description_of(example), "reason", @pending_caller)
178
+ formatter.should_receive(:example_pending).with(description_of(example), "reason")
180
179
  formatter.should_receive(:start_dump)
181
180
  formatter.should_receive(:dump_pending)
182
181
  formatter.should_receive(:dump_summary).with(anything(), 1, 0, 1)
183
182
  formatter.should_receive(:close).with(no_args)
184
- formatter.should_receive(:add_example_group).with(example_group_proxy)
183
+ formatter.should_receive(:example_group_started).with(example_group_proxy)
185
184
  example_group.notify(reporter)
186
185
  reporter.example_finished(description_of(example), @pending_error)
187
186
  reporter.dump
188
187
  end
189
188
 
190
- describe "to formatters which have example_pending's arity of 2 (which is now deprecated)" do
189
+ describe "to formatters which have example_pending's arity of 3 (which is now deprecated)" do
191
190
  before :each do
192
- Kernel.stub!(:warn).with(Spec::Runner::Reporter::EXAMPLE_PENDING_DEPRECATION_WARNING)
191
+ Spec.stub!(:warn)
193
192
 
194
193
  @deprecated_formatter = Class.new(@formatter.class) do
195
194
  attr_reader :example_passed_to_method, :message_passed_to_method
196
195
 
197
- def example_pending(example_passed_to_method, message_passed_to_method)
196
+ def example_pending(example_passed_to_method, message_passed_to_method, deprecated_third_arg=nil)
198
197
  @example_passed_to_method = example_passed_to_method
199
198
  @message_passed_to_method = message_passed_to_method
200
199
  end
@@ -204,12 +203,12 @@ module Spec
204
203
  end
205
204
 
206
205
  it "should pass the correct example description to the formatter" do
207
- description = Spec::Example::ExampleProxy.new("name")
208
- example = ExampleGroup.new(description)
206
+ proxy = Spec::Example::ExampleProxy.new("name")
207
+ example = ExampleGroup.new(proxy)
209
208
  example_group.notify(reporter)
210
209
  reporter.example_finished(description_of(example), @pending_error)
211
210
 
212
- @deprecated_formatter.example_passed_to_method.should == description
211
+ @deprecated_formatter.example_passed_to_method.should == proxy
213
212
  end
214
213
 
215
214
  it "should pass the correct pending error message to the formatter" do
@@ -221,7 +220,7 @@ module Spec
221
220
  end
222
221
 
223
222
  it "should raise a deprecation warning" do
224
- Kernel.should_receive(:warn).with(Spec::Runner::Reporter::EXAMPLE_PENDING_DEPRECATION_WARNING)
223
+ Spec.should_receive(:warn)
225
224
 
226
225
  example = ExampleGroup.new(example_proxy)
227
226
  example_group.notify(reporter)
@@ -235,7 +234,7 @@ module Spec
235
234
  formatter.should_receive(:example_failed) do |name, counter, failure|
236
235
  failure.header.should == "'example_group should do something' FIXED"
237
236
  end
238
- formatter.should_receive(:add_example_group).with(example_group_proxy)
237
+ formatter.should_receive(:example_group_started).with(example_group_proxy)
239
238
  example_group.notify(reporter)
240
239
  reporter.example_finished(description_of(example_group.examples.first), Spec::Example::PendingExampleFixedError.new("reason"))
241
240
  end