mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[Brightbox] Tests recognised options
Never actually tested the options we declared when creating a new instance of the Compute service.
This commit is contained in:
parent
a8c0de9eb6
commit
6da9aa7b6d
1 changed files with 30 additions and 4 deletions
|
@ -1,9 +1,35 @@
|
|||
Shindo.tests('Fog::Compute::Brightbox::Real', ['brightbox']) do
|
||||
Shindo.tests('Fog::Compute[:brightbox]', ['brightbox']) do
|
||||
|
||||
@bb = Fog::Compute::Brightbox::Real.new({})
|
||||
@test_service = Fog::Compute[:brightbox]
|
||||
|
||||
tests("#respond_to? :default_image").returns(true) do
|
||||
@bb.respond_to?(:default_image)
|
||||
@test_service.respond_to?(:default_image)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Shindo.tests('Fog::Compute.new', ['brightbox']) do
|
||||
|
||||
tests("service options") do
|
||||
{
|
||||
:brightbox_api_url => "https://example.com",
|
||||
:brightbox_auth_url => "https://example.com",
|
||||
:brightbox_client_id => "app-12345",
|
||||
:brightbox_secret => "12345abdef6789",
|
||||
:brightbox_username => "user-12345",
|
||||
:brightbox_password => "password1234",
|
||||
:brightbox_account => "acc-12345"
|
||||
}.each_pair do |option, sample|
|
||||
tests("recognises :#{option}").returns(true) do
|
||||
options = {:provider => "Brightbox"}
|
||||
options[option] = sample
|
||||
begin
|
||||
Fog::Compute.new(options)
|
||||
true
|
||||
rescue ArgumentError
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue