Permalink
Browse files

[ec2] use server models to simplify get_console_output spec

  • Loading branch information...
1 parent d9f3e88 commit 774cd921b6bb97f644cbbc93d9f10c2197a1f19b @geemus geemus committed May 10, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 spec/aws/requests/ec2/get_console_output_spec.rb
View
8 spec/aws/requests/ec2/get_console_output_spec.rb
@@ -4,16 +4,16 @@
describe 'success' do
before(:each) do
- @instance_id = AWS[:ec2].run_instances(GENTOO_AMI, 1, 1).body['instancesSet'].first['instanceId']
- AWS[:ec2].servers.get(@instance_id).wait_for { ready? }
+ @instance = AWS[:ec2].servers.create(:image_id => GENTOO_AMI)
+ @instance.wait_for { ready? }
end
after(:each) do
- AWS[:ec2].terminate_instances([@instance_id])
+ @instance.destroy
end
it "should return proper attributes" do
- actual = AWS[:ec2].get_console_output(@instance_id).body
+ actual = AWS[:ec2].get_console_output(@instance.id).body
actual['instanceId'].should be_a(String)
if actual['output']
actual['output'].should be_a(String)

0 comments on commit 774cd92

Please sign in to comment.