Sha256: 578c8f896967f6ed41db4e99e8449b125de683593e1ef10f0a9ffd0783c5b6df

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

require "test_helper"
require "cloudstack_client/configuration"

describe CloudstackClient::Configuration do

  describe "when the configuration is loaded without env" do
    it "must use the default env'" do
      CloudstackClient::Configuration.load({
        config_file: "#{File.expand_path File.dirname(__FILE__)}/data/cloudstack-1.yml",
        debug: true
      })[:environment].must_equal "test1"
    end
  end

  describe "when an alternative env is in the options" do
    it "must use the alternative env'" do
      CloudstackClient::Configuration.load({
        config_file: "#{File.expand_path File.dirname(__FILE__)}/data/cloudstack-1.yml",
        env: "test2",
        debug: true
      })[:environment].must_equal "test2"
    end
  end

  describe "when only one env is present" do
    it "must use the one existing configuration'" do
      CloudstackClient::Configuration.load({
        config_file: "#{File.expand_path File.dirname(__FILE__)}/data/cloudstack-2.yml",
        debug: true
      })[:api_key].must_equal "test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test-test"
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cloudstack_client-1.5.7 test/configuration_test.rb
cloudstack_client-1.5.6 test/configuration_test.rb
cloudstack_client-1.5.5 test/configuration_test.rb
cloudstack_client-1.5.4 test/configuration_test.rb
cloudstack_client-1.5.3 test/configuration_test.rb