Created
August 8, 2016 12:26
-
-
Save anonymous/da731b1b4eff7efbb7ca6771f4b84ea1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it 'throws a Psych::SyntaxError and continues without credentials when there are syntax errors in the auth file' do | |
data = "{:default'=>{:my_token=>'123456abcdef'}}" | |
allow_any_instance_of( MyApp::Parser ).to \ | |
receive(:read_file).and_return(data) | |
logger = double('logger') | |
expect(logger).to receive(:warn).with(/Psych::SyntaxError: .* has invalid syntax/) | |
make_opts = {:logger => logger} | |
parser = MyApp::Parser.new( make_hosts, make_opts ) | |
expect( parser.credentials ).to be == { } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment