Skip to content

Commit

Permalink
Use stub method [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Dec 28, 2021
1 parent b1b6857 commit e77dea5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions test/explain_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ def test_explain_multiple_statements
end

def with_explain_timeout(value)
previous_value = PgHero.explain_timeout_sec
begin
PgHero.explain_timeout_sec = value
PgHero.stub(:explain_timeout_sec, value) do
yield
ensure
PgHero.explain_timeout_sec = previous_value
end
end
end

0 comments on commit e77dea5

Please sign in to comment.