mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00

Currently most providers used by the `fog` binary give themselves a top level class. This has become the place a lookup table between services and the classes which implement them. This adds compatibility tests for the existing behaviour to allow controlled extraction to modules. This top level class behaviour is due to be deprecated and removed in fog 2.0
34 lines
725 B
Ruby
34 lines
725 B
Ruby
require "minitest/autorun"
|
|
require "fog"
|
|
require "fog/bin"
|
|
require "helpers/bin"
|
|
|
|
describe Atmos do
|
|
include Fog::BinSpec
|
|
|
|
let(:subject) { Atmos }
|
|
|
|
describe "#services" do
|
|
it "includes all services" do
|
|
assert_includes Atmos.services, :storage
|
|
end
|
|
end
|
|
|
|
describe "#class_for" do
|
|
describe "when requesting storage service" do
|
|
it "returns correct class" do
|
|
assert_equal Fog::Storage::Atmos, Atmos.class_for(:storage)
|
|
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
|