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:<br><blockquote>describe "Customer", "xml" do<br> fixtures :customers<br><br>
before(:all) do<br>
one = customers(:one)<br> end<br> <br> # ... <br>
</blockquote>
As a result, I got this message:<br><br><blockquote>1)<br>NoMethodError in 'Customer xml before(:all)'<br>You have a nil object when you didn't expect it!<br>You might have expected an instance of Array.<br>The error occurred while evaluating nil.[]
<br>./spec/models/customer_spec.rb:86:<br>script/spec:4:<br></blockquote>If I convert it to before(:each) or simply before, it works just fine.<br><blockquote>describe "Customer", "xml" do<br>
fixtures :customers<br><br>
before do<br>
one = customers(:one)<br> end<br>
<br>
# ... <br clear="all"></blockquote>
By design? bug? PEBKAC? Anyone else hit this?<br><br> - Geoffrey<br>-- <br>Geoffrey Wiseman<br>