Skip to content

Instantly share code, notes, and snippets.

@mlangenberg
Created September 14, 2008 20:57
Show Gist options
  • Save mlangenberg/10764 to your computer and use it in GitHub Desktop.
Save mlangenberg/10764 to your computer and use it in GitHub Desktop.
describe 'Car' do
describe "when starting" do
before :each do
@key = Key.new (or mock if Key.new requires too much setup code)
@car = Car.new(@key)
end
it "should insert key" do
@key.expects(:insert)
@car.start
end
it "should turn key" do
@key.expects(:turn)
@car.start
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment