Skip to content

Commit

Permalink
SignalException test \w more docs, flush for ruby 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dekellum committed Oct 18, 2017
1 parent 43fa779 commit 26a20e2
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions spec/commands/exec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,23 @@ def bin_path(a,b,c)
end
end

context "the executable exits by signal" do
let(:executable) { super() << "\nraise SignalException, 'SIGTERM'\n" }
let(:exit_code) { 128 + 15 }
context "the executable exits by SignalException" do
let(:executable) do
ex = super()
ex << "\n"
if LessThanProc.with(RUBY_VERSION).call( "1.9" )
# Ruby < 1.9 needs a flush for a exit by signal, later
# rubies do not
ex << "STDOUT.flush\n"
end
ex << "raise SignalException, 'SIGTERM'\n"
ex
end
let(:exit_code) do
# signal mask 128 + plus signal 15 -> TERM
# this is specified by C99
128 + 15
end
it_behaves_like "it runs"
end

Expand Down

0 comments on commit 26a20e2

Please sign in to comment.