1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/spec/fog/bin/atmos_spec.rb
Paul Thornthwaite 0ef2453fa0 Tests top level classes interface
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
2015-02-25 22:36:58 +00:00

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