Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Created November 17, 2008 01:03
Show Gist options
  • Save deadprogram/25619 to your computer and use it in GitHub Desktop.
Save deadprogram/25619 to your computer and use it in GitHub Desktop.
describe "create_snapshot" do
before(:each) do
@tr.ec2.stub!(:create_snapshot).and_return { @tr.ebs_volume_id.nil? ? nil : {"snapshotId" => "snap-123"} }
end
it "should create a snapshot of the current EBS volume" do
#@tr.ec2.stub!(:ebs_volume_id).and_return { "vol-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