mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-04-27 14:57:46 +00:00
silently(): Use ensure.
This commit is contained in:
parent
e9230a00c1
commit
db58d2c8ab
1 changed files with 3 additions and 4 deletions
|
|
@ -3,11 +3,10 @@ require File.expand_path('helper', File.dirname(__FILE__))
|
||||||
|
|
||||||
class TestHTTPCookie < Test::Unit::TestCase
|
class TestHTTPCookie < Test::Unit::TestCase
|
||||||
def silently
|
def silently
|
||||||
warn_level = $VERBOSE
|
warn_level, $VERBOSE = $VERBOSE, false
|
||||||
$VERBOSE = false
|
yield
|
||||||
res = yield
|
ensure
|
||||||
$VERBOSE = warn_level
|
$VERBOSE = warn_level
|
||||||
res
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue