diff --git a/fog.gemspec b/fog.gemspec index 9bc31d434..7ed9ba1f6 100644 --- a/fog.gemspec +++ b/fog.gemspec @@ -46,7 +46,7 @@ Gem::Specification.new do |s| ## List your runtime dependencies here. Runtime dependencies are those ## that are needed for an end user to actually USE your code. - s.add_dependency("fog-core", "~> 1.27", ">= 1.27.1") + s.add_dependency("fog-core", "~> 1.27", ">= 1.27.2") s.add_dependency("fog-json") s.add_dependency("fog-xml", "~> 0.1.1") diff --git a/spec/fog/account_spec.rb b/spec/fog/account_spec.rb new file mode 100644 index 000000000..2f7652cbf --- /dev/null +++ b/spec/fog/account_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Account do + Fog::Account.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 + assert_raises(ArgumentError) { Fog::Account[provider] } + end + end + end + end +end diff --git a/spec/fog/billing_spec.rb b/spec/fog/billing_spec.rb new file mode 100644 index 000000000..90045a5fe --- /dev/null +++ b/spec/fog/billing_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Billing do + Fog::Billing.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 + assert_raises(ArgumentError) { Fog::Billing[provider] } + end + end + end + end +end diff --git a/spec/fog/cdn_spec.rb b/spec/fog/cdn_spec.rb new file mode 100644 index 000000000..1f3664de5 --- /dev/null +++ b/spec/fog/cdn_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::CDN do + Fog::CDN.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 + assert_raises(ArgumentError) { Fog::CDN[provider] } + end + end + end + end +end diff --git a/spec/fog/compute_spec.rb b/spec/fog/compute_spec.rb index 89363cb99..53060081f 100644 --- a/spec/fog/compute_spec.rb +++ b/spec/fog/compute_spec.rb @@ -2,7 +2,19 @@ require "minitest/autorun" require "fog" describe Fog::Compute do - it "responds to []" do - assert_respond_to Fog::Compute, :[] + 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 end end diff --git a/spec/fog/dns_spec.rb b/spec/fog/dns_spec.rb new file mode 100644 index 000000000..4bb012b64 --- /dev/null +++ b/spec/fog/dns_spec.rb @@ -0,0 +1,20 @@ +require "minitest/autorun" +require "fog" + +describe Fog::DNS do + Fog::DNS.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 [:dnsimple].include?(provider) + assert Fog::DNS[provider] + else + assert_raises(ArgumentError) { Fog::DNS[provider] } + end + end + end + end + end +end diff --git a/spec/fog/identity_spec.rb b/spec/fog/identity_spec.rb new file mode 100644 index 000000000..9167ead76 --- /dev/null +++ b/spec/fog/identity_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Identity do + Fog::Identity.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 + assert_raises(ArgumentError) { Fog::Identity[provider] } + end + end + end + end +end diff --git a/spec/fog/image_spec.rb b/spec/fog/image_spec.rb new file mode 100644 index 000000000..a24df98ab --- /dev/null +++ b/spec/fog/image_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Image do + Fog::Image.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 + assert_raises(ArgumentError) { Fog::Image[provider] } + end + end + end + end +end diff --git a/spec/fog/metering_spec.rb b/spec/fog/metering_spec.rb new file mode 100644 index 000000000..30e705c90 --- /dev/null +++ b/spec/fog/metering_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Metering do + Fog::Metering.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 + assert_raises(ArgumentError) { Fog::Metering[provider] } + end + end + end + end +end diff --git a/spec/fog/monitoring_spec.rb b/spec/fog/monitoring_spec.rb new file mode 100644 index 000000000..7c3212e2d --- /dev/null +++ b/spec/fog/monitoring_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Monitoring do + Fog::Monitoring.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 + assert_raises(ArgumentError) { Fog::Monitoring[provider] } + end + end + end + end +end diff --git a/spec/fog/network_spec.rb b/spec/fog/network_spec.rb new file mode 100644 index 000000000..d35d23a85 --- /dev/null +++ b/spec/fog/network_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Network do + Fog::Network.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 + assert_raises(ArgumentError) { Fog::Network[provider] } + end + end + end + end +end diff --git a/spec/fog/orchestration_spec.rb b/spec/fog/orchestration_spec.rb new file mode 100644 index 000000000..132110a06 --- /dev/null +++ b/spec/fog/orchestration_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Orchestration do + Fog::Orchestration.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 + assert_raises(ArgumentError) { Fog::Orchestration[provider] } + end + end + end + end +end diff --git a/spec/fog/storage_spec.rb b/spec/fog/storage_spec.rb new file mode 100644 index 000000000..8db4a36e7 --- /dev/null +++ b/spec/fog/storage_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Storage do + Fog::Storage.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 + assert_raises(ArgumentError) { Fog::Storage[provider] } + end + end + end + end +end diff --git a/spec/fog/support_spec.rb b/spec/fog/support_spec.rb new file mode 100644 index 000000000..42cb42e84 --- /dev/null +++ b/spec/fog/support_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Support do + Fog::Support.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 + assert_raises(ArgumentError) { Fog::Support[provider] } + end + end + end + end +end diff --git a/spec/fog/volume_spec.rb b/spec/fog/volume_spec.rb new file mode 100644 index 000000000..77256b829 --- /dev/null +++ b/spec/fog/volume_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::Volume do + Fog::Volume.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 + assert_raises(ArgumentError) { Fog::Volume[provider] } + end + end + end + end +end diff --git a/spec/fog/vpn_spec.rb b/spec/fog/vpn_spec.rb new file mode 100644 index 000000000..e858971aa --- /dev/null +++ b/spec/fog/vpn_spec.rb @@ -0,0 +1,15 @@ +require "minitest/autorun" +require "fog" + +describe Fog::VPN do + Fog::VPN.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 + assert_raises(ArgumentError) { Fog::VPN[provider] } + end + end + end + end +end