[rspec-devel] [ rspec-Feature Requests-6508 ] Proper stacktrace for mocks

noreply at rubyforge.org noreply at rubyforge.org
Tue Feb 27 23:07:12 EST 2007


Feature Requests item #6508, was opened at 2006-11-06 01:42
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6508&group_id=797

Category: mock module
Group: None
>Status: Closed
Priority: 3
Submitted By: Aslak Hellesøy (aslak_hellesoy)
Assigned to: Nobody (None)
Summary: Proper stacktrace for mocks

Initial Comment:
run failing_examples/mocking_example.rb

This produces something like:

should fail when messages are received out of order
Mock 'one two three' received :three out of order
(eval):3:in `three'
/Users/aslakhellesoy/scm/rspec/trunk/failing_examples/mocking_example.rb:22:in `should fail when messages are received out of order'

The first line of the backtrace is bad. It shouldn't be there at all. When --backtrace is on it should show the line in RSpec's code. Can be achieved with extra args to eval (or is it class_eval)

----------------------------------------------------------------------

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-02-28 04:07

Message:
This was addressed some time ago. Here's the output I get now (rev 1549):

$ bin/spec failing_examples/mocking_example.rb   

.FFF

1)
Spec::Mocks::MockExpectationError in 'Mocker should fail when expected message not received'
Mock 'poke me' expected :poke with (any args) once, but received it 0 times
./failing_examples/mocking_example.rb:13:

2)
Spec::Mocks::MockExpectationError in 'Mocker should fail when messages are received out of order'
Mock 'one two three' received :three out of order
./failing_examples/mocking_example.rb:22:

3)
Spec::Mocks::MockExpectationError in 'Mocker should get yelled at when sending unexpected messages'
Mock 'don't talk to me' expected :any_message_at_all with (any args) 0 times, but received it once
./failing_examples/mocking_example.rb:28:

Finished in 0.003184 seconds

4 specifications, 3 failures


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6508&group_id=797


More information about the rspec-devel mailing list