Sha256: f305a2cc312e614a08e81e5164dcb0b7f236acbc9f372e266dc2ce3c25f6cd9b
Contents?: true
Size: 1.18 KB
Versions: 1
Compression:
Stored size: 1.18 KB
Contents
require 'spec_helper' describe Loader do describe '.autoload!' do let(:root_folder) { File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'autoload')) } before { Loader.autoload!(root_folder) } it 'should lazy load all the constants upon being used' do expect { Sample }.to_not raise_error expect { Sample::Dog }.to_not raise_error expect { Sample::Dog::Tail }.to_not raise_error expect { Sample::Cat::Paw }.to_not raise_error end it 'should require unrequired gems' do expect { YAML }.to_not raise_error end end describe '.require_relative_directory' do it 'should require the given relative folder content' do require_relative_directory 'fixtures/require_relative_directory/relative_folder' expect { TestConstant::Stuff }.to raise_error(NameError, 'uninitialized constant TestConstant::Stuff') expect { TestConstant }.to_not raise_error end it 'should require the given relative folder content recursively like this' do require_relative_directory 'fixtures/require_relative_directory/relative_folder_recursive/**' expect{ TestConstant2::Stuff2 }.to_not raise_error end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
loader-3.0.1 | spec/loader_spec.rb |