@@ -28,7 +28,7 @@ def _test_much_ado ; process_test_case("much_ado") ; end
28
28
def _test_namespaces ; process_test_case ( "namespaces" ) ; end
29
29
def _test_nitf ; process_test_case ( "nitf" ) ; end
30
30
def _test_numbers ; process_test_case ( "numbers" ) ; end
31
- def _test_pi ; process_test_case ( "pi" ) ; end
31
+ def test_pi ; process_test_case ( "pi" ) ; end
32
32
def _test_pi2 ; process_test_case ( "pi2" ) ; end
33
33
def _test_simple ; process_test_case ( "simple" ) ; end
34
34
def _test_testNamespaces ; process_test_case ( "testNamespaces" ) ; end
@@ -79,29 +79,12 @@ def process_context(doc, context)
79
79
def process_value_of ( context , variables , namespaces , value_of )
80
80
expected = value_of . text
81
81
xpath = value_of . attributes [ "select" ]
82
- matched = XPath . first ( context , xpath , namespaces , variables )
82
+ matched = XPath . match ( context , xpath , namespaces , variables )
83
83
84
84
message = user_message ( context , xpath , matched )
85
-
86
- if expected . nil?
87
- assert_nil ( matched , message )
88
- else
89
- case matched
90
- when Element
91
- assert_equal ( expected , matched . text , message )
92
- when Attribute , Text , Comment , TrueClass , FalseClass
93
- assert_equal ( expected , matched . to_s , message )
94
- when Instruction
95
- assert_equal ( expected , matched . content , message )
96
- when Integer , Float
97
- assert_equal ( expected . to_f , matched , message )
98
- when String
99
- assert_equal ( expected , matched , message )
100
- else
101
- flunk ( "#{ message } \n " +
102
- "Unexpected match value: <#{ matched . inspect } >" )
103
- end
104
- end
85
+ assert_equal ( expected || "" ,
86
+ REXML ::Functions . string ( matched ) ,
87
+ message )
105
88
end
106
89
107
90
# processes a tests/document/context/test node ( where @exception is false or doesn't exist )
0 commit comments