mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[Brightbox] Remove dependency on .fog in test
This isolates the tests from the values in `Fog.credentials` which is based on the contents of `~/.fog` Underlying problem is that the code (and many others) rely on the Fog global making it too tightly coupled to the environment hence having to stub. Full issue: https://github.com/fog/fog/issues/1390 This will probably be a repeating pattern we need to work on to DRY up so every test from every provider doesn't include this setup workaround.
This commit is contained in:
parent
f38e4417e8
commit
98cb07f59d
1 changed files with 18 additions and 2 deletions
|
@ -3,8 +3,24 @@ require "fog/brightbox"
|
|||
|
||||
class Fog::Compute::BrightboxTest < Minitest::Test
|
||||
def setup
|
||||
@arguments = {}
|
||||
@service = Fog::Compute::Brightbox.new(@arguments)
|
||||
@arguments = {
|
||||
:brightbox_auth_url => "http://localhost",
|
||||
:brightbox_api_url => "http://localhost",
|
||||
:brightbox_client_id => "",
|
||||
:brightbox_secret => "",
|
||||
:brightbox_username => "",
|
||||
:brightbox_password => "",
|
||||
:brightbox_account => ""
|
||||
}
|
||||
|
||||
@credential_guard = Minitest::Mock.new
|
||||
def @credential_guard.reject
|
||||
{}
|
||||
end
|
||||
|
||||
Fog.stub :credentials, @credential_guard do
|
||||
@service = Fog::Compute::Brightbox.new(@arguments)
|
||||
end
|
||||
end
|
||||
|
||||
def test_respond_to_request
|
||||
|
|
Loading…
Reference in a new issue