Sha256: dd1bec3f6d55faa7b3f5fc1e80fd329dd3a0d36caf774c6576069ffa447a1895

Contents?: true

Size: 963 Bytes

Versions: 17

Compression:

Stored size: 963 Bytes

Contents

require File.dirname(__FILE__) + "/../helpers"

class IntegrityTest < Test::Unit::TestCase
  describe "#new" do
    setup do
      stub(DataMapper).setup { nil }
      @config_file = File.dirname(__FILE__) + "/../../config/config.sample.yml"
    end

    it "doesn't require any argument" do
      Integrity.new

      assert_equal Integrity.default_configuration[:log],
        Integrity.config[:log]
    end

    it "loads configuration from a file" do
      Integrity.new(@config_file)

      assert_equal "http://integrity.domain.tld", Integrity.config[:base_uri]
      assert_equal "/path/to/scm/exports",        Integrity.config[:export_directory]
    end

    it "takes configuration as an hash" do
      Integrity.new(:base_uri => "http://foo.org")

      assert_equal "http://foo.org", Integrity.config[:base_uri]
    end
  end

  specify "config is just a hash" do
    Integrity.config[:foo] = "bar"
    Integrity.config[:foo].should == "bar"
  end
end

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
alphasights-integrity-0.1.10 test/unit/integrity_test.rb
alphasights-integrity-0.1.9.3 test/unit/integrity_test.rb
alphasights-integrity-0.1.9.4 test/unit/integrity_test.rb
alphasights-integrity-0.1.9.5 test/unit/integrity_test.rb
alphasights-integrity-0.1.9.6 test/unit/integrity_test.rb
alphasights-integrity-0.1.9.7 test/unit/integrity_test.rb
alphasights-integrity-0.1.9.8 test/unit/integrity_test.rb
foca-integrity-0.1.9.2 test/unit/integrity_test.rb
foca-integrity-0.1.9.3 test/unit/integrity_test.rb
gforces-integrity-0.1.9.3 test/unit/integrity_test.rb
gforces-integrity-0.1.9.4 test/unit/integrity_test.rb
integrity-integrity-0.1.10 test/unit/integrity_test.rb
integrity-integrity-0.1.9.3 test/unit/integrity_test.rb
integrity-0.1.11 test/unit/integrity_test.rb
integrity-0.1.10 test/unit/integrity_test.rb
integrity-0.1.9.3 test/unit/integrity_test.rb
integrity-0.1.9.2 test/unit/integrity_test.rb