Sha256: 1d0387c8d4d00f11f740a31931ebbfa974d13329953364a8e31dea0fa0c13363
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.absolute_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 { JSON }.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.0 | spec/loader_spec.rb |