Sha256: baf728a7daeca85aa0900418f7b4bc6e60f29bf76c86ba611ff56ac8f27b8b85

Contents?: true

Size: 748 Bytes

Versions: 1

Compression:

Stored size: 748 Bytes

Contents

require File.join(File.dirname(__FILE__), 'test_helper')

class Boson::RepoTest < Test::Unit::TestCase
  context "config" do
    before(:all) { reset }
    before(:each) { @repo = Boson::Repo.new(File.dirname(__FILE__)) }

    test "reloads config when passed true" do
      @repo.config.object_id.should_not == @repo.config(true).object_id
    end

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

    test "ignores nonexistent file and sets config defaults" do
      assert @repo.config[:command_aliases].is_a?(Hash) && @repo.config[:libraries].is_a?(Hash)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
boson-0.1.0 test/repo_test.rb