Skip to content

Commit

Permalink
adjust tests to ensure empty output raises eventually
Browse files Browse the repository at this point in the history
  • Loading branch information
dzuelke authored and schneems committed Jun 21, 2024
1 parent 2b99e62 commit f10250e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions spec/unit/heroku_run_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ def run_obj.run_shell!
@status = $?
end

run_obj.call

expect { run_obj.call }.to raise_error(Hatchet::HerokuRun::HerokuRunEmptyOutputError)
expect(run_obj.instance_variable_get(:@empty_fail_count)).to eq(3)
expect(stderr.string).to include("now retrying execution")
end
Expand All @@ -73,8 +72,7 @@ def run_obj.run_shell!
@status = $?
end

run_obj.call

expect { run_obj.call }.not_to raise_error(Hatchet::HerokuRun::HerokuRunEmptyOutputError)
expect(run_obj.instance_variable_get(:@empty_fail_count)).to eq(0)
expect(run_obj.output).to eq("not empty")
end
Expand All @@ -90,8 +88,7 @@ def run_obj.run_shell!
@status = $?
end

run_obj.call

expect { run_obj.call }.to raise_error(Hatchet::HerokuRun::HerokuRunEmptyOutputError)
expect(run_obj.instance_variable_get(:@empty_fail_count)).to eq(0)
expect(stderr.string).to_not include("now retrying execution")
end
Expand Down Expand Up @@ -128,8 +125,7 @@ def run_obj.run_shell!
@status = $?
end

run_obj.call

expect { run_obj.call }.to raise_error(Hatchet::HerokuRun::HerokuRunEmptyOutputError)
expect(run_obj.instance_variable_get(:@empty_fail_count)).to eq(0)
expect(stderr.string).to_not include("now retrying execution")
ensure
Expand Down

0 comments on commit f10250e

Please sign in to comment.