require "minitest/autorun"
require "fog/brightbox"

class Fog::Compute::BrightboxTest < Minitest::Test
  def setup
    @arguments = {}
    @service = Fog::Compute::Brightbox.new(@arguments)
  end

  def test_respond_to_request
    assert_respond_to @service, :request
  end

  def test_respond_to_request_access_token
    assert_respond_to @service, :request_access_token
  end

  def test_respond_to_wrapped_request
    assert_respond_to @service, :wrapped_request
  end
end

require "minitest/autorun"
require "fog/brightbox"

class Fog::Compute::BrightboxTest < Minitest::Test
  def setup
    @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
    assert_respond_to @service, :request
  end

  def test_respond_to_request_access_token
    assert_respond_to @service, :request_access_token
  end

  def test_respond_to_wrapped_request
    assert_respond_to @service, :wrapped_request
  end
end

Remove dependency on .fog in test
[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.
