Ruby Unit Test

 1 require 'test/unit'
 2 
 3 module Test::Unit::Assertions
 4     def assert_equal_unorder(exp, act, msg = nil)
 5         # msg = message(msg) {}
 6         assert_equal(exp.to_set, act.to_set, msg)
 7     end
 8 end
 9 
10 class TestKitty < Test::Unit::TestCase
11     def test_kitty
12         assert_equal_unorder([[]], partition(""))
13         assert_equal_unorder([["a"]], partition("a"))
14         assert_equal_unorder([["aa"], ["a", "a"]], partition("aa"))
15         assert_equal_unorder([["a", "a"], ["aa"]], partition("aa"))
16         assert_equal_unorder([["a", "b"]], partition("ab"))
17         assert_equal_unorder([["aa","b"], ["a","a","b"]], partition("aab"))
18     end
19 end

 

你可能感兴趣的:(Ruby Unit Test)