8000 Suppress warnings · ruby/csv@b37df55 · GitHub
[go: up one dir, main page]

Skip to content

Commit b37df55

Browse files
committed
Suppress warnings
1 parent bbf4cb5 commit b37df55

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

run-test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env ruby
22

3+
$VERBOSE = true
4+
35
$LOAD_PATH.unshift("test")
46
$LOAD_PATH.unshift("test/lib")
57
$LOAD_PATH.unshift("lib")

test/csv/write/test_general.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,27 @@ def test_with_default_internal
222222
end
223223
end
224224

225+
def with_verbose(verbose)
226+
original = $VERBOSE
227+
begin
228+
$VERBOSE = verbose
229+
yield
230+
ensure
231+
$VERBOSE = original
232+
end
233+
end
234+
225235
def with_default_internal(encoding)
226236
original = Encoding.default_internal
227237
begin
228-
Encoding.default_internal = encoding
238+
with_verbose(false) do
239+
Encoding.default_internal = encoding
240+
end
229241
yield
230242
ensure
231-
Encoding.default_internal = original
243+
with_verbose(false) do
244+
Encoding.default_internal = original
245+
end
232246
end
233247
end
234248
end

0 commit comments

Comments
 (0)
0