diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-21 00:39:57 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-21 00:39:57 +0000 |
commit | 17dde49326abb035ef14cd4be8b33337c6248e82 (patch) | |
tree | 56d367373041ffb1c72e6b288fda481c789eddce /test/minitest/test_minitest_spec.rb | |
parent | ba661182a40a486f089e63889897ab98d9db85b5 (diff) | |
download | ruby-17dde49326abb035ef14cd4be8b33337c6248e82.tar.gz |
Imported minitest 3.3.0 (r7676)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/minitest/test_minitest_spec.rb')
-rw-r--r-- | test/minitest/test_minitest_spec.rb | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/test/minitest/test_minitest_spec.rb b/test/minitest/test_minitest_spec.rb index d267e8d7d0..56aa78d620 100644 --- a/test/minitest/test_minitest_spec.rb +++ b/test/minitest/test_minitest_spec.rb @@ -637,20 +637,20 @@ class TestMeta < MiniTest::Unit::TestCase def test_structure x, y, z, * = util_structure - assert_equal "top-level thingy", x.to_s - assert_equal "top-level thingy::inner thingy", y.to_s + assert_equal "top-level thingy", x.to_s + assert_equal "top-level thingy::inner thingy", y.to_s assert_equal "top-level thingy::inner thingy::very inner thingy", z.to_s - assert_equal "top-level thingy", x.desc - assert_equal "inner thingy", y.desc + assert_equal "top-level thingy", x.desc + assert_equal "inner thingy", y.desc assert_equal "very inner thingy", z.desc - top_methods = %w(test_0001_top-level-it) - inner_methods1 = %w(test_0001_inner-it) + top_methods = %w(setup teardown test_0001_top-level-it) + inner_methods1 = %w(setup teardown test_0001_inner-it) inner_methods2 = inner_methods1 + %w(test_0002_anonymous test_0003_anonymous) - assert_equal top_methods, x.instance_methods(false).sort.map(&:to_s) + assert_equal top_methods, x.instance_methods(false).sort.map(&:to_s) assert_equal inner_methods1, y.instance_methods(false).sort.map(&:to_s) assert_equal inner_methods2, z.instance_methods(false).sort.map(&:to_s) end @@ -658,13 +658,18 @@ class TestMeta < MiniTest::Unit::TestCase def test_setup_teardown_behavior _, _, z, before_list, after_list = util_structure - tc = z.new(nil) + @tu = MiniTest::Unit.new + @output = StringIO.new("") + MiniTest::Unit.runner = nil # protect the outer runner from the inner tests + MiniTest::Unit.output = @output - tc.run_setup_hooks - tc.run_teardown_hooks + tc = z.new :test_0002_anonymous + tc.run @tu assert_equal [1, 2, 3], before_list assert_equal [3, 2, 1], after_list + ensure + MiniTest::Unit.output = $stdout end def test_children @@ -696,7 +701,7 @@ class TestMeta < MiniTest::Unit::TestCase z = describe "second thingy" do end end - test_methods = ['test_0001_top level it', 'test_0002_не латинские буквы-и-спецсимволы&いった α, β, γ, δ, ε hello!!! world'].sort + test_methods = ['test_0001_top level it', 'test_0002_не латинские буквы-и-спецсимволы&いった α, β, γ, δ, ε hello!!! world'].sort assert_equal test_methods, [x1, x2] assert_equal test_methods, |