Sha256: 8e7e388786a1be5d2fa1d51ce2e0178f97cb285ef2e1a598c3359308c37f7a4b

Contents?: true

Size: 778 Bytes

Versions: 14

Compression:

Stored size: 778 Bytes

Contents

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

14 entries across 14 versions & 3 rubygems

Version Path
boson-more-0.2.1 test/repo_test.rb
boson-more-0.2.0 test/repo_test.rb
boson-more-0.1.0 test/repo_test.rb
boson-0.4.0 test/repo_test.rb
bosonson-0.304.3 test/repo_test.rb
bosonson-0.304.2 test/repo_test.rb
bosonson-0.304.1 test/repo_test.rb
boson-0.3.4 test/repo_test.rb
boson-0.3.3 test/repo_test.rb
boson-0.3.2 test/repo_test.rb
boson-0.3.1 test/repo_test.rb
boson-0.3.0 test/repo_test.rb
boson-0.2.5 test/repo_test.rb
boson-0.2.4 test/repo_test.rb