@@ -111,7 +111,6 @@ def test_coerce_errors
111111 [ Integer , "one" ] => TypeError ,
112112 [ Float , "one" ] => TypeError ,
113113 [ String , Time ] => TypeError ,
114- [ :a , "one" ] => ArgumentError ,
115114 [ Date , "one" ] => ArgumentError ,
116115 [ Time , "one" ] => ArgumentError
117116 }
@@ -346,7 +345,7 @@ def test_coerce
346345 [ M2 , { a : "1990-09-19" , c : nil } ] => [ { yes : 2 , maybe : 2 } , { a : "1990-09-19" , c : nil } ] ,
347346
348347 [ M3 , { c : "c" , d : "d" } ] => [ { yes : 3 } , { c : :c , d : :d } ] ,
349- [ M3 , { c : "d" , d : "c" } ] => [ { yes : 1 , no : 2 } , { c : "d" , d : "c" } ] ,
348+ [ M3 , { c : "d" , d : "c" } ] => [ { yes : 1 , maybe : 2 } , { c : "d" , d : "c" } ] ,
350349
351350 [ M4 , { c : 2 } ] => [ { yes : 5 } , { c : 2 } ] ,
352351 [ M4 , { a : "1" , c : 2 } ] => [ { yes : 4 , maybe : 1 } , { a : "1" , c : 2 } ] ,
@@ -404,7 +403,8 @@ def test_accessors
404403 cases = {
405404 M2 . new ( { a : "1990-09-19" , b : "1" } ) => { a : Time . new ( 1990 , 9 , 19 ) , b : TypeError } ,
406405 M2 . new ( a : "one" , b : "one" ) => { a : ArgumentError , b : TypeError } ,
407- M2 . new ( a : nil , b : 2.0 ) => { a : TypeError , b : TypeError } ,
406+ M2 . new ( a : nil , b : 2.0 ) => { a : TypeError } ,
407+ M2 . new ( a : nil , b : 2.2 ) => { a : TypeError , b : ArgumentError } ,
408408
409409 M3 . new => { d : :d } ,
410410 M3 . new ( d : 1 ) => { d : ArgumentError } ,
@@ -520,8 +520,8 @@ def test_coerce
520520 [ U0 , :"" ] => [ { no : 1 } , 0 , :"" ] ,
521521
522522 [ U1 , "a" ] => [ { yes : 1 } , 1 , :a ] ,
523- [ U1 , "2" ] => [ { maybe : 1 } , 2 , 2 ] ,
524- [ U1 , :b ] => [ { no : 1 } , 2 , :b ] ,
523+ [ U1 , "2" ] => [ { maybe : 1 } , 2 , "2" ] ,
524+ [ U1 , :b ] => [ { maybe : 1 } , 2 , :b ] ,
525525
526526 [ U2 , { type : :a } ] => [ { yes : 3 } , 0 , { t : :a } ] ,
527527 [ U2 , { type : "b" } ] => [ { yes : 3 } , 0 , { type : :b } ] ,
0 commit comments