spec/provider/heroku_spec.rb in dpl-heroku-1.10.4.travis.3053.5 vs spec/provider/heroku_spec.rb in dpl-heroku-1.10.4.travis.3054.5

- old
+ new

@@ -259,9 +259,31 @@ expect(provider).to receive(:version).and_return 'v1.3.0' expect(provider.context).to receive(:shell).with("curl https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef -H 'Accept: application/vnd.heroku+json; version=3'") provider.trigger_build expect(provider.build_id).to eq('01234567-89ab-cdef-0123-456789abcdef') end + + context 'when $stdout is not a TTY' do + before do + @old_stdout = $stdout + $stdout = StringIO.new + end + + after do + $stdout = @old_stdout + end + + example do + expect(provider).to receive(:log).with('triggering new deployment') + expect(provider).to receive(:faraday).at_least(:once).and_return(faraday) + expect(provider).to receive(:get_url).and_return 'http://example.com/source.tgz' + expect(provider).to receive(:version).and_return 'v1.3.0' + expect(provider.context).to receive(:shell).with("curl -sS https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef -H 'Accept: application/vnd.heroku+json; version=3'") + provider.trigger_build + expect(provider.build_id).to eq('01234567-89ab-cdef-0123-456789abcdef') + end + + end end describe "#verify_build" do context 'when build succeeds' do example do