Sha256: b76f3c0fd2ee1b60c4b8d536b89148c15ece34580fd9d58c4674f74ca26bc461

Contents?: true

Size: 1.83 KB

Versions: 3

Compression:

Stored size: 1.83 KB

Contents

# Author: Nicolas Pouillard  <ertai@lrde.epita.fr>.
# Copyright: Copyright (c) 2004, 2005 TTK Team. All rights reserved.
# License: Ruby license.

# $LastChangedBy$
# $Id: yaml_test.rb 567 2005-04-13 08:00:06Z polrop $

require 'test/unit/ui/yaml/testrunner'
require 'ttk'

module TTK

  module Dumpers

    class Yaml

      class Test < Test::Unit::TestCase

        def test_simple
          in_ref = [
            [:new_node, :name, :map], [:new_leaf, "root"], [:up],
            [:new_node, :strategy], [:new_leaf, "Suite"], [:up],
            [:new_node, :contents, :seq],
              [:new_node, :sub1],
                [:new_node, :strategy], [:new_leaf, "Pool"], [:up],
                [:new_node, :test],
                  [:new_node, :subsub],
                [:new_node, :status], [:new_leaf, "PASS"], [:up],[:up],[:up],
                [:new_node, :foo], [:new_leaf, "bar"], [:up], [:up],
              [:new_node, :sub2],
                [:new_node, :status], [:new_leaf, "FAIL"], [:up],[:up],[:up],
            [:new_node, :status], [:new_leaf, "FAIL(50%)"], [:up],
          ]

          out_ref = <<-end
            ---
            name: root
            strategy: Suite
            contents:
              - sub1:
                  strategy: Pool
                  test:
                    subsub:
                      status: PASS
                  foo: bar
              - sub2:
                  status: FAIL
            status: FAIL(50%)
          end
          out_ref.gsub!(/^            /, '')

          out_my = StringIO.new
          logger = Logger.new(Yaml.new(out_my))
          in_ref.each { |a| logger.send(*a) }
          out_my.rewind

          assert_equal(out_ref, out_my.read)
        end

      end

    end # class Yaml

  end # module Dumpers

end # module TTK

Test::Unit::UI::Yaml::TestRunner.run(TTK::Dumpers::Yaml::Test)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ttk-0.1.576 test/runit/dumpers/yaml_test.rb
ttk-0.1.579 test/runit/dumpers/yaml_test.rb
ttk-0.1.580 test/runit/dumpers/yaml_test.rb