Skip to content

Commit 358c733

Browse files
committed
test: don't override Test::Unit::TestCase#run
GitHub: fix GH-109 It's not recommended. We should use setup. Reported by Mamoru TASAKA. Thanks!!!
1 parent fbba6de commit 358c733

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/tools/test_msginit.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ def setup
3232
stub(@msginit).revision_date {@po_revision_date}
3333

3434
Locale.current = "ja_JP.UTF-8"
35-
end
3635

37-
def run(*args, &blcok)
3836
Dir.mktmpdir do |dir|
3937
Dir.chdir(dir) do
40-
super
38+
yield
4139
end
4240
end
4341
end
@@ -171,9 +169,11 @@ def test_pot_not_found
171169

172170
class TestOutput < self
173171
def setup
174-
super
175-
@pot_file_path = "test.pot"
176-
create_pot_file(@pot_file_path)
172+
super do
173+
@pot_file_path = "test.pot"
174+
create_pot_file(@pot_file_path)
175+
yield
176+
end
177177
end
178178

179179
def test_default
@@ -313,8 +313,10 @@ def test_not_change
313313

314314
class TestPluralForms < self
315315
def setup
316-
super
317316
omit("Red Datasets is required") unless defined?(Datasets::CLDRPlurals)
317+
super do
318+
yield
319+
end
318320
end
319321

320322
def run_msginit(pot_header_options={})

0 commit comments

Comments
 (0)