summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-06 12:20:17 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-06 12:20:17 +0000
commit7e04b19d22f5b284782f9f1265d888ecbe339dd0 (patch)
treeab0317f11548a415a2368f9854839cf68b4efc37 /test/testunit
parente2b7469698fa75ac8849287d91724c266fb4d404 (diff)
* lib/test/unit.rb (_run_suites): Now reports are written the
following order: Skip, Failure, Error. [Feature #5282] * test_sorting.rb: test for above. * test4test_sorting.rb: Ditto. * lib/test/unit.rb (run): Put RUBY_DESCIPTION before quitting. [Feature #5282] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit')
-rw-r--r--test/testunit/test4test_sorting.rb15
-rw-r--r--test/testunit/test_sorting.rb17
2 files changed, 32 insertions, 0 deletions
diff --git a/test/testunit/test4test_sorting.rb b/test/testunit/test4test_sorting.rb
new file mode 100644
index 0000000..1f7f4a3
--- /dev/null
+++ b/test/testunit/test4test_sorting.rb
@@ -0,0 +1,15 @@
+require 'test/unit'
+
+class TestForTestHideSkip < Test::Unit::TestCase
+ def test_c
+ skip "do nothing"
+ end
+
+ def test_b
+ assert_equal true, false
+ end
+
+ def test_a
+ raise
+ end
+end
diff --git a/test/testunit/test_sorting.rb b/test/testunit/test_sorting.rb
new file mode 100644
index 0000000..ca85db5
--- /dev/null
+++ b/test/testunit/test_sorting.rb
@@ -0,0 +1,17 @@
+require 'test/unit'
+
+class TestTestUnitSorting < Test::Unit::TestCase
+ def test_sorting
+ test_out, o = IO.pipe
+ spawn(*@options[:ruby], "#{File.dirname(__FILE__)}/test4test_sorting.rb",
+ out: o, err: o)
+ o.close
+ result = test_out.read
+
+ assert_match(/^ 1\) Skipped:/, result)
+ assert_match(/^ 2\) Failure:/, result)
+ assert_match(/^ 3\) Error:/, result)
+
+ test_out.close
+ end
+end