Properly set the Config object's @config variable when loading
This commit is contained in:
parent
69d31f8a1e
commit
b3fd19e0af
|
@ -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?
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue