2015-03-14 23:54:55 +00:00
|
|
|
require "spec_helper"
|
2014-12-11 00:07:40 +00:00
|
|
|
|
|
|
|
describe Fog::Compute do
|
2014-12-18 09:18:27 +00:00
|
|
|
Fog::Compute.providers.each do |provider|
|
|
|
|
describe "when #{provider} is passed with no available credentials" do
|
|
|
|
it "returns ArgumentError" do
|
|
|
|
# Stub credentials so you still see errors where the tester really has credentials
|
|
|
|
Fog.stub :credentials, {} do
|
|
|
|
# These providers do not raise ArgumentError since they have no requirements defined
|
|
|
|
if [:openvz, :vmfusion].include?(provider)
|
|
|
|
assert Fog::Compute[provider]
|
|
|
|
else
|
|
|
|
assert_raises(ArgumentError) { Fog::Compute[provider] }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2014-12-11 00:07:40 +00:00
|
|
|
end
|
|
|
|
end
|