I was planning on using a fixture within a description that didn't modify
the fixture, so I put it in a before(:all) block:
describe "Customer", "xml" do
fixtures :customers
before(:all) do
one = customers(:one)
end
# ...
As a result, I got this message:
1)
NoMethodError in 'Customer xml before(:all)'
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]
./spec/models/customer_spec.rb:86:
script/spec:4:
If I convert it to before(:each) or simply before, it works just fine.
describe "Customer", "xml" do
fixtures :customers
before do
one = customers(:one)
end
# ...
By design? bug? PEBKAC? Anyone else hit this?
- Geoffrey
--
Geoffrey Wiseman
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users