[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
Thu Oct 5 03:02:50 EDT 2006


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

Category: None
Group: None
Status: Open
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.

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

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