1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/spec/helpers/bin.rb
Paul Thornthwaite d8e62a60f5 Test Provider[] errors when unknown
The global behaviour for passing an unknown service to a top level class
is raising an `ArgumentError` (after some debugging line).

We may as well test this globally.
2015-02-25 22:36:58 +00:00

34 lines
807 B
Ruby

module Fog
module BinSpec
extend Minitest::Spec::DSL
it "responds to available?" do
assert_respond_to subject, :available?
end
it "responds to class_for" do
assert_respond_to subject, :class_for
end
it "#class_for raises ArgumentError for unknown services" do
assert_raises(ArgumentError) { subject.class_for(:unknown) }
end
it "responds to collections" do
skip if subject == ::Google
assert_respond_to subject, :collections
end
it "responds to []" do
assert_respond_to subject, :[]
end
it "#[] when unknown service is passed raises ArgumentError" do
assert_raises(ArgumentError) { subject[:bad_service] }
end
it "responds to services" do
assert_respond_to subject, :services
end
end
end