Remove tests for deprecated binary `#[]`

Fog originally allowed use of `Provider[:service]` to generate a new
instance of a service. This was deprecated since it was not portable.
Using `AWS[:compute]` makes it harder to switch providers since all the
classes needed renaming. Ideally `Compute[@provider]` would be used and
can be configured within an application.

The `fog` script ("binary") had a number of backwards-compatibility
specs have been testing that the old methods worked. These generated
deprecation warnings as they ran.

Whilst the behaviour is still intact, this removes the tests that are
creating deprecation noise since no one is likely to be using them.
This commit is contained in:
Paul Thornthwaite 2018-06-18 17:57:41 +01:00
parent b7d2e03bc4
commit 0bda54cff9
4 changed files with 0 additions and 56 deletions

View File

@ -20,14 +20,4 @@ describe Atmos do
end
end
end
describe "#[]" do
describe "when requesting storage service" do
it "returns instance" do
Fog::Storage::Atmos.stub(:new, "instance") do
assert_equal "instance", Atmos[:storage]
end
end
end
end
end

View File

@ -77,22 +77,4 @@ describe AWS do
end
end
end
describe "#[]" do
describe "when service is recognised" do
it "returns correct instance" do
KEY_CLASS_MAPPING.each do |key, klass|
klass.stub(:new, "#{klass} instance") do
assert_equal "#{klass} instance", AWS[key]
end
end
end
end
describe "when service is not recognised" do
it "raises ArgumentError" do
assert_raises(ArgumentError) { AWS[:bad_service] }
end
end
end
end

View File

@ -20,14 +20,4 @@ describe BareMetalCloud do
end
end
end
describe "#[]" do
describe "when requesting compute service" do
it "returns instance" do
Fog::Compute::BareMetalCloud.stub(:new, "instance") do
assert_equal "instance", BareMetalCloud[:compute]
end
end
end
end
end

View File

@ -34,22 +34,4 @@ describe Bluebox do
end
end
end
describe "#[]" do
describe "when requesting compute service" do
it "returns instance" do
Fog::Compute::Bluebox.stub(:new, "instance") do
assert_equal "instance", Bluebox[:compute]
end
end
end
describe "when requesting dns service" do
it "returns instance" do
Fog::DNS::Bluebox.stub(:new, "instance") do
assert_equal "instance", Bluebox[:dns]
end
end
end
end
end