Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (20 sloc) 800 Bytes
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
Something went wrong with that request. Please try again.