Sha256: ba224a8f7a8b6e436c831faf859d65699a5598574cf0a29c252f7273595e516c

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

require 'test_helper'

module GitWit
  def self._config; @_config; end
end

class ConfigTest < ActiveSupport::TestCase
  def setup
    GitWit.stash_config
    GitWit.default_config!
  end

  def teardown
    GitWit.restore_config
  end

  test "should expose a configuration interface" do
    assert_kind_of Hash, GitWit._config
    assert !GitWit._config.insecure_write
    GitWit.configure do |config|
      config.insecure_write = true
    end
    assert GitWit._config.insecure_write
  end

  test "should empty the config when reset" do
    GitWit.reset_config!
    assert !GitWit._config.present?
  end

  test "should load reasonable config defaults" do
    assert_kind_of Hash, GitWit._config
    assert GitWit._config.present?
    assert_kind_of String, GitWit._config.realm
    assert_kind_of String, GitWit._config.repositories_path
    assert !GitWit._config.insecure_write
    assert !GitWit._config.insecure_auth
  end

  test "should expose important config parameters directly" do
    %w(repositories_path ssh_user realm git_path 
      insecure_write insecure_auth).each do |p|
      assert GitWit.respond_to?(p.to_sym)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
git_wit-0.0.6 test/unit/config_test.rb
git_wit-0.0.6.pre test/unit/config_test.rb
git_wit-0.0.5 test/unit/config_test.rb
git_wit-0.0.4.pre2 test/unit/config_test.rb
git_wit-0.0.4.pre test/unit/config_test.rb