Sha256: e063f87c1c13175c6f4956ee84b8725eb962d5b0b341e6e595a083fff8b1dc70

Contents?: true

Size: 905 Bytes

Versions: 2

Compression:

Stored size: 905 Bytes

Contents

require File.expand_path('../test_helper', __FILE__)

describe "gitdocs configuration" do
  before do
    capture_out { @config = Gitdocs::Configuration.new("/tmp/gitdocs") }
  end

  it "has sensible default config root" do
    assert_equal "/tmp/gitdocs", @config.config_root
  end

  it "can retrieve empty shares" do
    assert_equal [], @config.shares
  end

  it "can have a path added" do
    @config.add_path('/my/path')
    assert_equal "/my/path", @config.shares.first.path
    assert_equal 15.0, @config.shares.first.polling_interval
  end

  it "can have a path removed" do
    @config.add_path('/my/path')
    @config.add_path('/my/path/2')
    @config.remove_path('/my/path/2')
    assert_equal ["/my/path"], @config.shares.map(&:path)
  end

  it "can normalize paths" do
    assert_equal File.expand_path("../test_helper.rb", Dir.pwd), @config.normalize_path("../test_helper.rb")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gitdocs-0.3.1 test/configuration_test.rb
gitdocs-0.3.0 test/configuration_test.rb