Skip to content

Instantly share code, notes, and snippets.

@auser
Created November 17, 2008 01:13
Show Gist options
  • Save auser/25624 to your computer and use it in GitHub Desktop.
Save auser/25624 to your computer and use it in GitHub Desktop.
describe "create_snapshot" do
# We can assume that create_snapshot on the ec2 gem works
before(:each) do
@tr.ec2.stub!(:create_snapshot).and_return nil
end
it "should create a snapshot of the current EBS volume" do
#@tr.ec2.stub!(:ebs_volume_id).and_return { "vol-123" }
@tr.ec2.stub!(:create_snapshot).and_return {"snapshotId" => "snap-123"}
@tr.ebs_volume_id = "vol-123"
@tr.create_snapshot.should == {"snapshotId" => "snap-123"}
end
it "should not create a snapshot if there is no EBS volume" do
@tr.create_snapshot.should == nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment