在测试类方法时,我不需要自动创建实例。隐式主题是自动创建的,还是仅在引用时创建?
describe MyClass do
it 'uses implicit subject' do
subject.my_method.should be_true
end
it 'does not create a subject' do
MyClass.works?.should be_true
# subject should not have been created
end
end