end
it 'should have nil attribute' do
@match.attribute.should be_nil
end
it 'should not be a match' do
@match.should_not be_a_match
end
end
end
下面是 RSpec 例子:
describe Legislator, 'dynamic find_by_first_name' do
it 'should call find(:first_name => first_name)' do
Legislator.should_receive(:find).with(:first_name => 'John')
Legislator.find_by_first_name('John')
end
end










