On Sep 8, 2007, at 5:47 PM, aslak hellesoy wrote: > On 9/8/07, Scott Taylor <[EMAIL PROTECTED]> wrote: >> >> On Sep 7, 2007, at 3:31 PM, Geoffrey Wiseman wrote: >> >>> 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? >>> >> >> Looks like a bug to me, although I don't know why you would want to >> load a fixture only once, and not before every test. Generally, I >> don't find much use for a before(:all) block (they are discouraged in >> Test::Unit as well, for their unreliable use with more than one >> test). >> > > Like I said - it's by design. > > It's been discussed in previous mail threads. > > Aslak
Sorry, didn't see your post on the thread. Scott _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users