Sha256: 930876671095b170c6c8f5781e1edba3d62a3fe09a3f59c1e474edfd18cb68cc
Contents?: true
Size: 1.39 KB
Versions: 28
Compression:
Stored size: 1.39 KB
Contents
require "spec_helper" describe Brightbox::BBConfig do describe "#account" do context "when passed as an option" do before do @account_name = "acc-kll54" @config = Brightbox::BBConfig.new(:account => @account_name) end it "returns the passed version" do expect(@config.account).to eql(@account_name) end end context "when config has no default account" do before do contents = <<-EOS [core] default_client = default [default] key = value EOS @config = config_from_contents(contents) end it "returns nil" do expect(@config.account).to be_nil end end context "when config has a default account set" do before do @account_name = "acc-ghj32" @client_name = "app-b3n5b" contents = <<-EOS [core] default_client = #{@client_name} [#{@client_name}] default_account = #{@account_name} EOS @config = config_from_contents(contents) # Never hit the API expect(Brightbox::Account).to_not receive(:all) end it "returns the configured default" do expect(@config.account).to eql(@account_name) end it "does not dirty the config" do expect do @config.account end.to_not change(@config, :dirty?) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems