[rspec-devel] [ rspec-Bugs-6027 ] rSpec for Rails fails on helper teardown if no teardown is defined within context

noreply at rubyforge.org noreply at rubyforge.org
Wed Nov 8 15:50:56 EST 2006


Bugs item #6027, was opened at 2006-10-05 07:02
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6027&group_id=797

Category: None
Group: None
>Status: Closed
Resolution: None
Priority: 3
Submitted By: Jan Wikholm (jwikholm)
Assigned to: Nobody (None)
Summary: rSpec for Rails fails on helper teardown if no teardown is defined within context

Initial Comment:
rSpec version 0.6.4 & corresponding rspec_for_rails

I had a normal rspec generated by script/generate rspec_model company and had written specs for it.

All specs pass otherwise but completely Fail on teardown, which is called from spec/spec_helper.rb(line 23)

One example:

1)
NoMethodError in 'A company (in general) should be invalid without a name'
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.-
./spec/models/../spec_helper.rb:23:in `teardown'


That is same thing is printed for every specify block I have in my specs.

After doing a simple:

def teardown
end

in each context block the problem disappeared.

It's not hard to fix it yourself, but I feel that defining an empty method for the sake of tests passing is not the way to go.

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

>Comment By: David Chelimsky (dchelimsky)
Date: 2006-11-08 20:50

Message:
N/A after 0.7

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

Comment By: David Chelimsky (dchelimsky)
Date: 2006-11-07 10:47

Message:
Is this still a problem in 0.7?

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

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


More information about the rspec-devel mailing list