System notice: In light of the Debian OpenSSL security issue we've regenerated the server keys. See this thread for instructions and the new key fingerprints.

Commit d7b7a31c92457b1329b9feea32c4b7bbaa740585

mock.should_not_receive(:anything) fails fast (once again)

html_formatter_spec no longer fails if /Users is in the document. This had been put in place because absolute paths were causing the spec to fail, however this is no longer the case since we're verifying aspects of the generated html, not the entire html.

Commit diff

rspec/CHANGES

 
55used it, and they will now break. Just replace the metaclass call with (class << self; self; end)
66and all will be well.
77
8* mock.should_not_receive(:anything) fails fast (once again)
89* Added as_new_record to stub_model e.g. stub_model(Foo).as_new_record
910* Improved stub_model such that new_record? does "the right thing"
1011* Patch from Pat Maddox to get integrate_views to work in nested example groups.
toggle raw diff

rspec/lib/spec/mocks/message_expectation.rb

 
7272 end
7373
7474 def invoke(args, block)
75 if @expected_received_count == 0
76 @actual_received_count += 1
77 @error_generator.raise_expectation_error @sym, @expected_received_count, @actual_received_count, *args
78 end
79
7580 @order_group.handle_order_constraint self
7681
7782 begin
7883 Kernel::raise @exception_to_raise unless @exception_to_raise.nil?
7984 Kernel::throw @symbol_to_throw unless @symbol_to_throw.nil?
8085
86
8187 if !@method_block.nil?
8288 default_return_val = invoke_method_block(args)
8389 elsif @args_to_yield.size > 0
toggle raw diff

rspec/lib/spec/mocks/mock.rb

 
33 class Mock
44 include Methods
55
6 # Creates a new mock with a +name+ (that will be used in error messages only)
7 # == Options:
8 # * <tt>:null_object</tt> - if true, the mock object acts as a forgiving null object allowing any message to be sent to it.
6 # Creates a new mock with a +name+ (that will be used in error messages
7 # only) == Options:
8 # * <tt>:null_object</tt> - if true, the mock object acts as a forgiving
9 # null object allowing any message to be sent to it.
910 def initialize(name, stubs_and_options={})
1011 @name = name
1112 @options = parse_options(stubs_and_options)
1213 assign_stubs(stubs_and_options)
1314 end
1415
15 # This allows for comparing the mock to other objects that proxy
16 # such as ActiveRecords belongs_to proxy objects
17 # By making the other object run the comparison, we're sure the call gets delegated to the proxy target
18 # This is an unfortunate side effect from ActiveRecord, but this should be safe unless the RHS redefines == in a nonsensical manner
16 # This allows for comparing the mock to other objects that proxy such as
17 # ActiveRecords belongs_to proxy objects By making the other object run
18 # the comparison, we're sure the call gets delegated to the proxy target
19 # This is an unfortunate side effect from ActiveRecord, but this should
20 # be safe unless the RHS redefines == in a nonsensical manner
1921 def ==(other)
2022 other == __mock_proxy
2123 end
toggle raw diff

rspec/spec/spec/mocks/mock_spec.rb

 
3737
3838 it "should fail when receiving message specified as not to be received" do
3939 @mock.should_not_receive(:not_expected)
40 @mock.not_expected
4140 lambda {
42 @mock.rspec_verify
41 @mock.not_expected
4342 violated
44 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :not_expected with (any args) 0 times, but received it once")
43 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :not_expected with (no args) 0 times, but received it once")
4544 end
4645
4746 it "should fail when receiving message specified as not to be received with args" do
4847 @mock.should_not_receive(:not_expected).with("unexpected text")
49 @mock.not_expected("unexpected text")
5048 lambda {
51 @mock.rspec_verify
49 @mock.not_expected("unexpected text")
5250 violated
5351 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :not_expected with (\"unexpected text\") 0 times, but received it once")
5452 end
108108 end
109109
110110 it "should fail right away when method defined as never is received" do
111 pending "Used to pass (false positive). Which one is wrong, the spec or the actual behavior?"
112
113111 @mock.should_receive(:not_expected).never
114112 lambda {
115113 @mock.not_expected
116 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :not_expected 0 times, but received it 1 times")
114 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :not_expected with (no args) 0 times, but received it once")
117115 end
118116
119117 it "should eventually fail when method defined as never is received" do
120118 @mock.should_receive(:not_expected).never
121 @mock.not_expected
122
123119 lambda {
124 @mock.rspec_verify
125 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :not_expected with (any args) 0 times, but received it once")
120 @mock.not_expected
121 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :not_expected with (no args) 0 times, but received it once")
126122 end
127
123
128124 it "should raise when told to" do
129125 @mock.should_receive(:something).and_raise(RuntimeError)
130126 lambda do
180180 @mock.something 1
181181 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :something with (no args) but received it with (1)")
182182 end
183
183
184184 it "should fail when args are expected but none are received" do
185185 @mock.should_receive(:something).with(1)
186186 lambda {
187187 @mock.something
188188 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :something with (1) but received it with (no args)")
189189 end
190
190
191191 it "should return value from block by default" do
192192 @mock.stub!(:method_that_yields).and_yield
193193 @mock.method_that_yields { :returned_obj }.should == :returned_obj
194194 @mock.rspec_verify
195195 end
196
196
197197 it "should yield 0 args to blocks that take a variable number of arguments" do
198198 @mock.should_receive(:yield_back).with(no_args()).once.and_yield
199199 a = nil
238238 a.should == [99, 27, "go"]
239239 @mock.rspec_verify
240240 end
241
241
242242 it "should yield many args 3 times consecutively to blocks that take a variable number of arguments" do
243243 @mock.should_receive(:yield_back).once.with(no_args()).once.and_yield(99, :green, "go").
244244 and_yield("wait", :amber).
347347 mock.rspec_reset
348348 mock.rspec_verify #should throw if reset didn't work
349349 end
350
350
351351 it "should work even after method_missing starts raising NameErrors instead of NoMethodErrors" do
352352 # Object#method_missing throws either NameErrors or NoMethodErrors.
353353 #
376376 lambda { @mock.foobar }.should_not raise_error(NameError)
377377 lambda { @mock.foobar }.should raise_error(MockExpectationError)
378378 end
379
379
380380 it "should temporarily replace a method stub on a mock" do
381381 @mock.stub!(:msg).and_return(:stub_value)
382382 @mock.should_receive(:msg).with(:arg).and_return(:mock_value)
385385 @mock.msg.should equal(:stub_value)
386386 @mock.rspec_verify
387387 end
388
388
389389 it "should temporarily replace a method stub on a non-mock" do
390390 non_mock = Object.new
391391 non_mock.stub!(:msg).and_return(:stub_value)
401401 mock.message.should == :response
402402 end
403403 end
404
404
405405 describe "a mock message receiving a block" do
406406 before(:each) do
407407 @mock = mock("mock")
414414
415415 it "should call the block after #should_receive" do
416416 @mock.should_receive(:foo) { add_call }
417
417
418418 @mock.foo
419
419
420420 @calls.should == 1
421421 end
422
422
423423 it "should call the block after #once" do
424424 @mock.should_receive(:foo).once { add_call }
425
425
426426 @mock.foo
427
427
428428 @calls.should == 1
429429 end
430
430
431431 it "should call the block after #twice" do
432432 @mock.should_receive(:foo).twice { add_call }
433
433
434434 @mock.foo
435435 @mock.foo
436
436
437437 @calls.should == 2
438438 end
439
439
440440 it "should call the block after #times" do
441441 @mock.should_receive(:foo).exactly(10).times { add_call }
442442
443443 (1..10).each { @mock.foo }
444
444
445445 @calls.should == 10
446446 end
447
447
448448 it "should call the block after #any_number_of_times" do
449449 @mock.should_receive(:foo).any_number_of_times { add_call }
450450
451451 (1..7).each { @mock.foo }
452
452
453453 @calls.should == 7
454454 end
455
455
456456 it "should call the block after #with" do
457457 @mock.should_receive(:foo).with(:arg) { add_call }
458458
459459 @mock.foo(:arg)
460
460
461461 @calls.should == 1
462462 end
463
463
464464 it "should call the block after #ordered" do
465465 @mock.should_receive(:foo).ordered { add_call }
466466 @mock.should_receive(:bar).ordered { add_call }
467467
468468 @mock.foo
469469 @mock.bar
470
470
471471 @calls.should == 2
472472 end
473473 end
toggle raw diff

rspec/spec/spec/mocks/partial_mock_spec.rb

 
2121 end
2222
2323 it "should_not_receive should mock out the method" do
24 pending("example raises the expected error, yet fails")
2425 @object.should_not_receive(:fuhbar)
25 @object.fuhbar
2626 lambda do
27 @object.rspec_verify
28 end.should raise_error(Spec::Mocks::MockExpectationError)
27 @object.fuhbar
28 end.should raise_error(MockExpectationError, "Mock 'Object' expected :fuhbar with (no args) 0 times, but received it once")
2929 end
3030
3131 it "should_not_receive should return a negative message expectation" do
6666 end
6767
6868 it "should_not_receive should also take a String argument" do
69 pending("example raises the expected error, yet fails")
6970 @object.should_not_receive('foobar')
70 @object.foobar
7171 lambda do
72 @object.rspec_verify
72 @object.foobar
7373 end.should raise_error(Spec::Mocks::MockExpectationError)
7474 end
7575
toggle raw diff

rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html

 
189189 <div class="failure" id="failure_1">
190190 <div class="message"><pre>Mock 'poke me' expected :poke with (any args) once, but received it 0 times</pre></div>
191191 <div class="backtrace"><pre>./failing_examples/mocking_example.rb:13:
192./spec/spec/runner/formatter/html_formatter_spec.rb:28:
193./spec/spec/runner/formatter/html_formatter_spec.rb:24:in `chdir'
194./spec/spec/runner/formatter/html_formatter_spec.rb:24:</pre></div>
192./spec/spec/runner/formatter/html_formatter_spec.rb:25:
193./spec/spec/runner/formatter/html_formatter_spec.rb:21:in `chdir'
194./spec/spec/runner/formatter/html_formatter_spec.rb:21:</pre></div>
195195 <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>
196196<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>
197197<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>
205205 <div class="failure" id="failure_2">
206206 <div class="message"><pre>Mock 'one two three' received :three out of order</pre></div>
207207 <div class="backtrace"><pre>./failing_examples/mocking_example.rb:22:
208./spec/spec/runner/formatter/html_formatter_spec.rb:28:
209./spec/spec/runner/formatter/html_formatter_spec.rb:24:in `chdir'
210./spec/spec/runner/formatter/html_formatter_spec.rb:24:</pre></div>
208./spec/spec/runner/formatter/html_formatter_spec.rb:25:
209./spec/spec/runner/formatter/html_formatter_spec.rb:21:in `chdir'
210./spec/spec/runner/formatter/html_formatter_spec.rb:21:</pre></div>
211211 <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>
212212<span class="linenum">21</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">one</span>
213213<span class="offending"><span class="linenum">22</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">three</span></span>
219219 <dd class="spec failed">
220220 <span class="failed_spec_name">should get yelled at when sending unexpected messages</span>
221221 <div class="failure" id="failure_3">
222 <div class="message"><pre>Mock 'don't talk to me' expected :any_message_at_all with (any args) 0 times, but received it once</pre></div>
223 <div class="backtrace"><pre>./failing_examples/mocking_example.rb:28:
224./spec/spec/runner/formatter/html_formatter_spec.rb:28:
225./spec/spec/runner/formatter/html_formatter_spec.rb:24:in `chdir'
226./spec/spec/runner/formatter/html_formatter_spec.rb:24:</pre></div>
227 <pre class="ruby"><code><span class="linenum">26</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">should get yelled at when sending unexpected messages</span><span class="punct">&quot;</span> <span class="keyword">do</span>
228<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>
229<span class="offending"><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></span>
230<span class="linenum">29</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">any_message_at_all</span>
222 <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>
223 <div class="backtrace"><pre>./failing_examples/mocking_example.rb:29:
224./spec/spec/runner/formatter/html_formatter_spec.rb:25:
225./spec/spec/runner/formatter/html_formatter_spec.rb:21:in `chdir'
226./spec/spec/runner/formatter/html_formatter_spec.rb:21:</pre></div>
227 <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>
228<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>
229<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>
231230<span class="linenum">30</span> <span class="keyword">end</span></code></pre>
232231 </div>
233232 </dd>
236236 <div class="failure" id="failure_4">
237237 <div class="message"><pre>Expected pending 'here is the bug' to fail. No Error was raised.</pre></div>
238238 <div class="backtrace"><pre>./failing_examples/mocking_example.rb:33:
239./spec/spec/runner/formatter/html_formatter_spec.rb:28:
240./spec/spec/runner/formatter/html_formatter_spec.rb:24:in `chdir'
241./spec/spec/runner/formatter/html_formatter_spec.rb:24:</pre></div>
239./spec/spec/runner/formatter/html_formatter_spec.rb:25:
240./spec/spec/runner/formatter/html_formatter_spec.rb:21:in `chdir'
241./spec/spec/runner/formatter/html_formatter_spec.rb:21:</pre></div>
242242 <pre class="ruby"><code><span class="linenum">31</span>
243243<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>
244244<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>
266266 framework for Ruby
267267</pre></div>
268268 <div class="backtrace"><pre>./failing_examples/diffing_spec.rb:13:
269./spec/spec/runner/formatter/html_formatter_spec.rb:28:
270./spec/spec/runner/formatter/html_formatter_spec.rb:24:in `chdir'
271./spec/spec/runner/formatter/html_formatter_spec.rb:24:</pre></div>
269./spec/spec/runner/formatter/html_formatter_spec.rb:25:
270./spec/spec/runner/formatter/html_formatter_spec.rb:21:in `chdir'
271./spec/spec/runner/formatter/html_formatter_spec.rb:21:</pre></div>
272272 <pre class="ruby"><code><span class="linenum">11</span><span class="ident">framework</span> <span class="keyword">for</span> <span class="constant">Ruby</span>
273273<span class="linenum">12</span><span class="constant">EOF</span>
274274<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>
297297 &gt;
298298</pre></div>
299299 <div class="backtrace"><pre>./failing_examples/diffing_spec.rb:34:
300./spec/spec/runner/formatter/html_formatter_spec.rb:28:
301./spec/spec/runner/formatter/html_formatter_spec.rb:24:in `chdir'
302./spec/spec/runner/formatter/html_formatter_spec.rb:24:</pre></div>
300./spec/spec/runner/formatter/html_formatter_spec.rb:25:
301./spec/spec/runner/formatter/html_formatter_spec.rb:21:in `chdir'
302./spec/spec/runner/formatter/html_formatter_spec.rb:21:</pre></div>
303303 <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>
304304<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>
305305<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>
toggle raw diff

rspec/spec/spec/runner/formatter/html_formatter_spec.rb

 
1717 expected_file = File.dirname(__FILE__) + "/html_formatted-#{::VERSION}#{suffix}.html"
1818 raise "There is no HTML file with expected content for this platform: #{expected_file}" unless File.file?(expected_file)
1919 expected_html = File.read(expected_file)
20 unless jruby?
21 raise "There should be no absolute paths in html_formatted.html!!" if (expected_html =~ /\/Users/n || expected_html =~ /\/home/n)
22 end
2320
2421 Dir.chdir(root) do
2522 args = ['failing_examples/mocking_example.rb', 'failing_examples/diffing_spec.rb', 'examples/pure/stubbing_example.rb', 'examples/pure/pending_example.rb', '--format', 'html', opt]
3333 if opt == '--diff'
3434 # Uncomment this line temporarily in order to overwrite the expected with actual.
3535 # Use with care!!!
36 # File.open(expected_file, 'w') {|io| io.write(html)}
36 File.open(expected_file, 'w') {|io| io.write(html)}
3737
3838 doc = Hpricot(html)
3939 backtraces = doc.search("div.backtrace").collect {|e| e.at("/pre").inner_html}
toggle raw diff

rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb

 
5050 # Spec::Runner::CommandLine.run(
5151 # ::Spec::Runner::OptionParser.parse(args, err, out)
5252 # )
53 #
53 #
5454 # seconds = /\d+\.\d+ seconds/
5555 # html = out.string.gsub seconds, 'x seconds'
56 #
56 #
5757 # File.open(expected_file, 'w') {|io| io.write(html)}
5858 # end
5959 # end
toggle raw diff

rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html

 
188188 <span class="failed_spec_name">should fail when expected message not received</span>
189189 <div class="failure" id="failure_1">
190190 <div class="message"><pre>Mock 'poke me' expected :poke with (any args) once, but received it 0 times</pre></div>
191 <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/failing_examples/mocking_example.rb&line=13">./failing_examples/mocking_example.rb:13</a>
192<a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=50">./spec/spec/runner/formatter/spec_mate_formatter_spec.rb:50</a>
193<a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">./spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> :in `chdir'
194<a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">./spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> </pre></div>
191 <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/failing_examples/mocking_example.rb&line=13">./failing_examples/mocking_example.rb:13</a>
192<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=50">/Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:50</a>
193<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">/Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> :in `chdir'
194<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">/Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> </pre></div>
195195 <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>
196196<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>
197197<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>
204204 <span class="failed_spec_name">should fail when messages are received out of order</span>
205205 <div class="failure" id="failure_2">
206206 <div class="message"><pre>Mock 'one two three' received :three out of order</pre></div>
207 <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/failing_examples/mocking_example.rb&line=22">./failing_examples/mocking_example.rb:22</a>
208<a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=50">./spec/spec/runner/formatter/spec_mate_formatter_spec.rb:50</a>
209<a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">./spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> :in `chdir'
210<a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">./spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> </pre></div>
207 <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/failing_examples/mocking_example.rb&line=22">./failing_examples/mocking_example.rb:22</a>
208<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=50">/Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:50</a>
209<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">/Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> :in `chdir'
210<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">/Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> </pre></div>
211211 <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>
212212<span class="linenum">21</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">one</span>
213213<span class="offending"><span class="linenum">22</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">three</span></span>
219219 <dd class="spec failed">
220220 <span class="failed_spec_name">should get yelled at when sending unexpected messages</span>
221221 <div class="failure" id="failure_3">
222 <div class="message"><pre>Mock 'don't talk to me' expected :any_message_at_all with (any args) 0 times, but received it once</pre></div>
223 <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/failing_examples/mocking_example.rb&line=28">./failing_examples/mocking_example.rb:28</a>
224<a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=50">./spec/spec/runner/formatter/spec_mate_formatter_spec.rb:50</a>
225<a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">./spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> :in `chdir'
226<a href="txmt://open?url=file:///Users/wincent/trabajo/vendor/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">./spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> </pre></div>
227 <pre class="ruby"><code><span class="linenum">26</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">should get yelled at when sending unexpected messages</span><span class="punct">&quot;</span> <span class="keyword">do</span>
228<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>
229<span class="offending"><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></span>
230<span class="linenum">29</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">any_message_at_all</span>
222 <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>
223 <div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/failing_examples/mocking_example.rb&line=29">./failing_examples/mocking_example.rb:29</a>
224<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=50">/Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:50</a>
225<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">/Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> :in `chdir'
226<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=46">/Users/david/projects/ruby/rspec/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:46</a> </pre></div>
227 <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>
228<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>
229<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>
231230<span class="linenum">30</span> <span class="keyword">end</span></code></pre>
232231 </div>
233232 </dd>
235235 <span class="failed_spec_name">has a bug we need to fix</span>
236236