spec/libraries/config_spec.rb in alchemy_cms-3.2.1 vs spec/libraries/config_spec.rb in alchemy_cms-3.3.0.rc1

- old
+ new

@@ -1,10 +1,9 @@ require 'spec_helper' module Alchemy describe Config do - describe ".get" do it "should call #show" do expect(Config).to receive(:show).and_return({}) Config.get(:mailer) end @@ -53,19 +52,19 @@ end end describe '.read_file' do context 'when given path to yml file exists' do - before { allow(File).to receive(:exists?).and_return(true) } + before { allow(File).to receive(:exist?).and_return(true) } it 'should call YAML.load_file with the given config path' do expect(YAML).to 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 - allow(File).to receive(:exists?).with('empty_file.yml').and_return(true) + allow(File).to receive(:exist?).with('empty_file.yml').and_return(true) allow(YAML).to receive(: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({})