@@ -24,8 +24,7 @@ def test_canonicalize_with_w3c_c14n_3_1
2424 expected_1_1_without_comments = IO . read ( self . path ( 'c14n/result/1-1-without-comments/example-1' ) )
2525 mode = LibXML ::XML ::Document ::XML_C14N_1_1
2626 assert_equal ( expected_1_1_without_comments , given_doc . canonicalize ( :mode => mode ) )
27- end #test_canonicalize_with_w3c_c14n_3_1
28-
27+ end
2928
3029 # (www.w3.org) 3.2 Whitespace in Document Content
3130 # http://www.w3.org/TR/xml-c14n#Example-WhitespaceInContent
@@ -106,15 +105,15 @@ def test_canonicalize_with_w3c_c14n_3_6
106105 # http://www.w3.org/TR/xml-c14n#Example-DocSubsets
107106 def test_canonicalize_with_w3c_c14n_3_7
108107 # Non Canonicalized Document
109- # given_doc = LibXML::XML::Document.file(self.path('c14n/given/example-7.xml'))
110- # expected = IO.read(self.path('c14n/result/without-comments/example-7'))
108+ given_doc = LibXML ::XML ::Document . file ( self . path ( 'c14n/given/example-7.xml' ) )
109+ expected = IO . read ( self . path ( 'c14n/result/without-comments/example-7' ) )
111110
112- # e1_node = given_doc.find_first('ietf:e1', 'ietf:http://www.ietf.org')
111+ e1_node = given_doc . find_first ( 'ietf:e1' , 'ietf:http://www.ietf.org' )
113112
114113 # Select current node, all child nodes, all attributes and namespace nodes
115- # subdoc_nodes = e1_node.find("(.//.|.//@id|namespace::*)")
114+ subdoc_nodes = e1_node . find ( "(.//.|.//@id|namespace::*)" )
116115
117116 # TODO - This fails because the namespace nodes aren't taken into account
118- # assert_equal(expected, given_doc.canonicalize(:nodes => subdoc_nodes))
117+ assert_equal ( expected , given_doc . canonicalize ( :nodes => subdoc_nodes ) )
119118 end
120119end
0 commit comments