Sha256: 6928e2f039ab5e465fe66bcbfba737c4182e11479c81829d7d56610cbe7a3c81

Contents?: true

Size: 800 Bytes

Versions: 3

Compression:

Stored size: 800 Bytes

Contents

require 'boson/repo'
require File.join(File.dirname(__FILE__), 'test_helper')

describe "config" do
  before_all { reset }
  before { @repo = Repo.new(File.dirname(__FILE__)) }

  it "reloads config when passed true" do
    @repo.config.object_id.should.not == @repo.config(true).object_id
  end

  it "reads existing config correctly" do
    expected_hash = {:commands=>{'c1'=>{}}, :libraries=>{}}
    File.expects(:exists?).returns(true)
    YAML.expects(:load_file).returns(expected_hash)
    @repo.config[:commands]['c1'].should == {}
  end

  it "ignores nonexistent file and sets config defaults" do
    @repo.config[:command_aliases].class.should == Hash
    @repo.config[:libraries].class.should == Hash
  end
  after_all { FileUtils.rm_r File.dirname(__FILE__)+'/config', :force=>true }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
boson-more-0.3.1 test/repo_test.rb
boson-more-0.3.0 test/repo_test.rb
boson-more-0.2.2 test/repo_test.rb