diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-17 13:46:56 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-17 13:46:56 +0000 |
commit | 2a15d25a5941301b5be6bc29eb4ac97d5aafe3dc (patch) | |
tree | 32ed30c63502d98c54555945ded41a4d0161c662 /test/rexml/test_light.rb | |
parent | 146bf4fdafefc780d65f20c983d65f9cbe3bfe2d (diff) |
* test/rexml/: untabify.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml/test_light.rb')
-rw-r--r-- | test/rexml/test_light.rb | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/test/rexml/test_light.rb b/test/rexml/test_light.rb index 8db830147d..7ccf61298c 100644 --- a/test/rexml/test_light.rb +++ b/test/rexml/test_light.rb @@ -6,97 +6,97 @@ class LightTester < Test::Unit::TestCase include REXMLTestUtils include REXML::Light - def test_parse_large - parser = REXML::Parsers::LightParser.new(fixture_path("documentation.xml")) - root = parser.parse - end - - # FIXME INCOMPLETE - # This is because the light API is not yet ready to be used to produce - # trees. + def test_parse_large + parser = REXML::Parsers::LightParser.new(fixture_path("documentation.xml")) + root = parser.parse + end + + # FIXME INCOMPLETE + # This is because the light API is not yet ready to be used to produce + # trees. =begin - def test_add_element - doc = Node.new - foo = doc.add_element( 'foo' ) - assert_equal( "foo", foo.name ) - end - - def test_add_attribute - foo = Node.new( "a" ) - foo["attr"] = "bar" - assert_equal( "bar", foo["attr"] ) - end + def test_add_element + doc = Node.new + foo = doc.add_element( 'foo' ) + assert_equal( "foo", foo.name ) + end + + def test_add_attribute + foo = Node.new( "a" ) + foo["attr"] = "bar" + assert_equal( "bar", foo["attr"] ) + end - def test_write_document - r = make_small_document - assert_equal( "<a><b/><c/></a>", r.to_s ) - end + def test_write_document + r = make_small_document + assert_equal( "<a><b/><c/></a>", r.to_s ) + end - def test_add_attribute_under_namespace - foo = Node.new("a") - foo["attr", "a"] = "1" - foo["attr", "b"] = "2" - foo["attr"] = "3" - assert_equal( '1', foo['attr', 'a'] ) - assert_equal( '2', foo['attr', 'b'] ) - assert_equal( '3', foo['attr'] ) - end + def test_add_attribute_under_namespace + foo = Node.new("a") + foo["attr", "a"] = "1" + foo["attr", "b"] = "2" + foo["attr"] = "3" + assert_equal( '1', foo['attr', 'a'] ) + assert_equal( '2', foo['attr', 'b'] ) + assert_equal( '3', foo['attr'] ) + end - def test_change_namespace_of_element - foo = Node.new - assert_equal( '', foo.namespace ) - foo.namespace = 'a' - assert_equal( 'a', foo.namespace ) - end + def test_change_namespace_of_element + foo = Node.new + assert_equal( '', foo.namespace ) + foo.namespace = 'a' + assert_equal( 'a', foo.namespace ) + end - def test_access_child_elements - foo = make_small_document - assert_equal( 1, foo.size ) - a = foo[0] - assert_equal( 2, a.size ) - assert_equal( 'b', a[0].name ) - assert_equal( 'c', a[1].name ) - end + def test_access_child_elements + foo = make_small_document + assert_equal( 1, foo.size ) + a = foo[0] + assert_equal( 2, a.size ) + assert_equal( 'b', a[0].name ) + assert_equal( 'c', a[1].name ) + end - def test_itterate_over_children - foo = make_small_document - ctr = 0 - foo[0].each { ctr += 1 } - assert_equal( 2, ctr ) - end + def test_itterate_over_children + foo = make_small_document + ctr = 0 + foo[0].each { ctr += 1 } + assert_equal( 2, ctr ) + end - def test_add_text - foo = Node.new( "a" ) - foo.add_text( "Sean" ) - sean = foo[0] - assert( sean.node_type == :text ) - end + def test_add_text + foo = Node.new( "a" ) + foo.add_text( "Sean" ) + sean = foo[0] + assert( sean.node_type == :text ) + end - def test_add_instruction - foo = Node.new( "a" ) - foo.add_instruction( "target", "value" ) - assert( foo[0].node_type == :processing_instruction ) - end + def test_add_instruction + foo = Node.new( "a" ) + foo.add_instruction( "target", "value" ) + assert( foo[0].node_type == :processing_instruction ) + end - def test_add_comment - foo = Node.new( "a" ) - foo.add_comment( "target", "value" ) - assert( foo[0].node_type == :comment ) - end + def test_add_comment + foo = Node.new( "a" ) + foo.add_comment( "target", "value" ) + assert( foo[0].node_type == :comment ) + end - def test_get_root - foo = Node.new( 'a' ) - 10.times { foo = foo.add_element('b') } - assert_equals( 'b', foo.name ) - assert_equals( 'a', foo.root.name ) - end + def test_get_root + foo = Node.new( 'a' ) + 10.times { foo = foo.add_element('b') } + assert_equals( 'b', foo.name ) + assert_equals( 'a', foo.root.name ) + end - def make_small_document - r = Node.new - a = r.add_element( "a" ) - a.add_element( 'b' ) - a.add_element( 'c' ) - r - end + def make_small_document + r = Node.new + a = r.add_element( "a" ) + a.add_element( 'b' ) + a.add_element( 'c' ) + r + end =end end |