Sha256: 86ed02bfb69f8893e911b8b922de87c8a3bfa07c8288919043ea37f2c5bf589d

Contents?: true

Size: 668 Bytes

Versions: 6

Compression:

Stored size: 668 Bytes

Contents

require 'test_helper'
require 'rubycritic/configuration'

describe Rubycritic::Configuration do
  describe '#root' do
    before do
      Rubycritic::Config.set
      @default = Rubycritic::Config.root
    end

    it 'has a default' do
      Rubycritic::Config.root.must_be_instance_of String
    end

    it 'can be set to a relative path' do
      Rubycritic::Config.root = 'foo'
      Rubycritic::Config.root.must_equal File.expand_path('foo')
    end

    it 'can be set to an absolute path' do
      Rubycritic::Config.root = '/foo'
      Rubycritic::Config.root.must_equal '/foo'
    end

    after do
      Rubycritic::Config.root = @default
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubycritic-2.9.2 test/lib/rubycritic/configuration_test.rb
rubycritic-2.9.1 test/lib/rubycritic/configuration_test.rb
rubycritic-2.9.0 test/lib/rubycritic/configuration_test.rb
rubycritic-2.8.0 test/lib/rubycritic/configuration_test.rb
rubycritic-2.7.1 test/lib/rubycritic/configuration_test.rb
rubycritic-2.7.0 test/lib/rubycritic/configuration_test.rb