Skip to content

Instantly share code, notes, and snippets.

@caryp
Created July 21, 2009 02:16
Show Gist options
  • Save caryp/151058 to your computer and use it in GitHub Desktop.
Save caryp/151058 to your computer and use it in GitHub Desktop.
diff --git a/spec/ohai/plugins/ec2_spec.rb b/spec/ohai/plugins/ec2_spec.rb
index 8ffb1ef..ddd046e 100644
--- a/spec/ohai/plugins/ec2_spec.rb
+++ b/spec/ohai/plugins/ec2_spec.rb
@@ -51,6 +51,10 @@ describe Ohai::System, "plugin ec2" do
end
it "should recursively fetch all the ec2 metadata" do
+ IO.stub!(:select).and_return([[],[1],[]])
+ t = mock("connection")
+ t.stub!(:connect_nonblock).and_raise(Errno::EINPROGRESS)
+ Socket.stub!(:new).and_return(t)
@ohai._require_plugin("ec2")
@ohai[:ec2].should_not be_nil
@ohai[:ec2]['instance_type'].should == "c1.medium"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment