Sha256: 039e44633ac296fe71a1a2df3c1f6b851388c1b5c28b5de181f4e77dfdee90e8

Contents?: true

Size: 1.87 KB

Versions: 6

Compression:

Stored size: 1.87 KB

Contents

# Author::    Nicolas Pouillard  <ertai@lrde.epita.fr>.
# Copyright:: Copyright (c) 2004, 2005 Uttk Team. All rights reserved.
# License::   LGPL
# Revision::  $Id: /w/fey/uttk/trunk/test/unit/dumpers/xml_test.rb 21975 2006-02-19T22:24:11.182512Z pouillar  $

test_section __FILE__ do

module Uttk

  module Dumpers

    class Xml

      class Test < Test::Unit::TestCase

        def test_simple
          ref_output = <<-end
            <?xml version="1.0" encoding="iso-8859-1"?>
            <node name='root' type='Uttk::Strategies::Suite'>
              <node name='contents'>
                <node name='sub1' type='Uttk::Strategies::Cmd'>
                  <node name='foo'>bar</node>
                  <node name='test'>
                    <node name='subsub'>
                      <node name='status'>PASS</node>
                    </node>
                  </node>
                </node>
                <node name='sub2'>
                  <node name='status'>FAILED</node>
                </node>
              </node>
              <node name='status'>1/2</node>
            </node>
          end
          ref_output.gsub!(/^            /, '')

          TempPath.new do |my_output|
            io = my_output.open('w')
            log = Logger.new(Xml.new(io))
            log.new_node :root, :type => Strategies::Suite do
              log.new_node :contents, :ordered => true do
                log.new_node :sub1, :type => Strategies::Cmd do
                  log.foo = :bar
                  log.test = { :subsub => { :status => :PASS } }
                end
                log.sub2 = { :status => :FAILED }
              end
              log.status = '1/2'
            end
            log.close
            io.close
            assert_equal(ref_output, my_output.read)
          end
        end

      end # class Test

    end # class Xml

  end # module Dumpers

end # module Uttk

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
uttk-0.3.5.0 test/unit/dumpers/xml_test.rb
uttk-0.3.1.2 test/unit/dumpers/xml_test.rb
uttk-0.3.6.1 test/unit/dumpers/xml_test.rb
uttk-0.4.5.0 test/unit/dumpers/xml_test.rb
uttk-0.4.6.2 test/unit/dumpers/xml_test.rb
uttk-0.4.6.1 test/unit/dumpers/xml_test.rb