Sha256: 6d0e84ad21970a40c77f9b4c9cc4bb2576cebbc6bd966068ca65cd9312edb22c

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe RConfig do
  before :each do
    RConfig.load_paths = ['spec/config']
  end

  context 'load paths' do
    it 'should have a valid load path' do
      RConfig.load_paths.should_not be_blank
      RConfig.load_paths.all?{|path| File.exists?(path) }.should be_truthy
    end

    it 'should allow multiple load paths' do
      lambda { RConfig.add_load_path('spec/config2') }.should_not raise_error
      RConfig.load_paths.size.should == 2
    end

    it 'should not allow duplicate load paths' do
      RConfig.add_load_path('spec/config')
      RConfig.load_paths.size.should == 1
    end

    it 'should not allow nil paths' do
      lambda { RConfig.add_load_path(nil) }.should raise_error(ArgumentError)
    end

    it 'should not allow blank paths' do
      lambda { RConfig.add_load_path('') }.should raise_error(ArgumentError)
    end

    it 'shoud not allow paths that do not exist' do
      lambda { RConfig.add_load_path('/bad/path') }.should raise_error(RConfig::InvalidLoadPathError)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rconfig-0.5.4 spec/rconfig/load_paths_spec.rb