这很奇怪。以下代码:
describe "Spike" do
before(:all) do
something = double('name')
end
describe "a test" do
it "is basic" do
1.should == 1
end
end
end
失败:
NoMethodError: undefined method `double' for #<RSpec::Core::ExampleGroup::Nested_1:0x9dec5e8 @__memoized=nil>
./spec/unit/whatever/spike_spec.rb:3:in `block (2 levels) in '
更改before(:all)
为before(:each)
,一切都很好。我正在使用 Ruby 1.9.3
有任何想法吗?