Properly set the Config object's @config variable when loading

This commit is contained in:
R. Tyler Croy 2012-12-17 22:51:59 -08:00
parent 69d31f8a1e
commit b3fd19e0af
2 changed files with 7 additions and 5 deletions

View File

@ -20,12 +20,9 @@ module Sauce
def load!
return config unless config.nil?
return nil if filepath.nil?
if filepath.nil?
return nil
end
config = YAML.load_file(filepath)
@config = YAML.load_file(filepath)
end
def configured?

View File

@ -30,7 +30,12 @@ describe Heroku::Command::Sauce do
describe '#scout_url' do
subject { command.send(:scout_url) }
context 'when not configured' do
let(:config) { mock('Mock Config', :configured? => false) }
before :each do
command.instance_variable_set(:@config, config)
end
it { should be_nil }
end