spec/libraries/config_spec.rb in alchemy_cms-2.9.1 vs spec/libraries/config_spec.rb in alchemy_cms-3.0.0.rc5
- old
+ new
@@ -53,20 +53,20 @@
end
end
describe '.read_file' do
context 'when given path to yml file exists' do
- before { File.stub!(:exists?).and_return(true) }
+ before { File.stub(:exists?).and_return(true) }
it 'should call YAML.load_file with the given config path' do
YAML.should_receive(:load_file).once.with('path/to/config.yml').and_return({})
Config.send(:read_file, 'path/to/config.yml')
end
context 'but its empty' do
before do
- File.stub!(:exists?).with('empty_file.yml').and_return(true)
- YAML.stub!(:load_file).and_return(false) # YAML.load_file returns false if file is empty.
+ File.stub(:exists?).with('empty_file.yml').and_return(true)
+ YAML.stub(:load_file).and_return(false) # YAML.load_file returns false if file is empty.
end
it "should return an empty Hash" do
expect(Config.send(:read_file, 'empty_file.yml')).to eq({})
end