summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@opscode.com>2012-12-06 14:24:56 -0800
committerBryan McLellan <btm@opscode.com>2012-12-06 14:24:56 -0800
commit3d39f871a08cb5398ba61bbbabffbcd005a89d1f (patch)
treeebf8052badcb424f3013ebfc69f025b416e159da
parent5828c0e74fe8e5d28ffd3d14d116374d6efe7f8a (diff)
downloadohai-3d39f871a08cb5398ba61bbbabffbcd005a89d1f.tar.gz
OHAI-416: Add tests for get_region
-rw-r--r--spec/ohai/plugins/rackspace_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ohai/plugins/rackspace_spec.rb b/spec/ohai/plugins/rackspace_spec.rb
index 4031803e..7490e1e1 100644
--- a/spec/ohai/plugins/rackspace_spec.rb
+++ b/spec/ohai/plugins/rackspace_spec.rb
@@ -94,6 +94,20 @@ describe Ohai::System, "plugin rackspace" do
@ohai[:rackspace][:public_ipv6].should == "2a00:1a48:7805:111:e875:efaf:ff08:75"
end
+ it "should capture region information" do
+ @stderr = StringIO.new
+ @stdout = <<-OUT
+provider = "Rackspace"
+service_type = "cloudServers"
+server_id = "21301000"
+created_at = "2012-12-06T22:08:16Z"
+region = "dfw"
+OUT
+ @status = 0
+ @ohai.stub(:run_command).with({:no_status_check=>true, :command=>"xenstore-ls vm-data/provider_data"}).and_return([ @status, @stdout, @stderr ])
+ @ohai._require_plugin("rackspace")
+ @ohai[:rackspace][:region].should == "dfw"
+ end
end
describe "with rackspace mac and hostname" do