Sha256: d7459a1171fd87f9b3c817d93639f1f59dc279cca4eb55c72536dac9fca909f5

Contents?: true

Size: 1.1 KB

Versions: 22

Compression:

Stored size: 1.1 KB

Contents

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

describe "gitdocs configuration" do
  before do
    ShellTools.capture { @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/../my/path') # normalized test
    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/../my/path/2') # normalized test
    assert_equal ["/my/path"], @config.shares.map(&:path)
  end

  it "can clear paths" do
    @config.add_path('/my/path')
    @config.add_path('/my/path/2')
    @config.clear
    assert_equal [], @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

22 entries across 22 versions & 2 rubygems

Version Path
gitdocs-0.4.15 test/configuration_test.rb
siuying-gitdocs-0.4.16 test/configuration_test.rb
siuying-gitdocs-0.4.15 test/configuration_test.rb
siuying-gitdocs-0.4.14 test/configuration_test.rb
siuying-gitdocs-0.4.14.md test/configuration_test.rb
gitdocs-0.4.14 test/configuration_test.rb
gitdocs-0.4.13 test/configuration_test.rb
gitdocs-0.4.12 test/configuration_test.rb
gitdocs-0.4.11 test/configuration_test.rb
gitdocs-0.4.10 test/configuration_test.rb
gitdocs-0.4.9 test/configuration_test.rb
gitdocs-0.4.8 test/configuration_test.rb
gitdocs-0.4.7 test/configuration_test.rb
gitdocs-0.4.6 test/configuration_test.rb
gitdocs-0.4.5 test/configuration_test.rb
gitdocs-0.4.3 test/configuration_test.rb
gitdocs-0.4.2 test/configuration_test.rb
gitdocs-0.4.1 test/configuration_test.rb
gitdocs-0.4.0 test/configuration_test.rb
gitdocs-0.3.6 test/configuration_test.rb