Skip to content

Commit

Permalink
test: don't override Test::Unit::TestCase#run
Browse files Browse the repository at this point in the history
GitHub: fix GH-109

It's not recommended. We should use setup.

Reported by Mamoru TASAKA. Thanks!!!
  • Loading branch information
kou committed Dec 4, 2024
1 parent fbba6de commit 358c733
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/tools/test_msginit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ def setup
stub(@msginit).revision_date {@po_revision_date}

Locale.current = "ja_JP.UTF-8"
end

def run(*args, &blcok)
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
super
yield
end
end
end
Expand Down Expand Up @@ -171,9 +169,11 @@ def test_pot_not_found

class TestOutput < self
def setup
super
@pot_file_path = "test.pot"
create_pot_file(@pot_file_path)
super do
@pot_file_path = "test.pot"
create_pot_file(@pot_file_path)
yield
end
end

def test_default
Expand Down Expand Up @@ -313,8 +313,10 @@ def test_not_change

class TestPluralForms < self
def setup
super
omit("Red Datasets is required") unless defined?(Datasets::CLDRPlurals)
super do
yield
end
end

def run_msginit(pot_header_options={})
Expand Down

0 comments on commit 358c733

Please sign in to comment.