summaryrefslogtreecommitdiffstats
path: root/test/lib/puppettest/testcase.rb
blob: 9af0292b468b86f8d729ce53918aee7faa228a0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env ruby
#
#  Created by Luke A. Kanies on 2007-03-05.
#  Copyright (c) 2007. All rights reserved.

require 'puppettest'
require 'puppettest/runnable_test'

class PuppetTest::TestCase < Test::Unit::TestCase
    include PuppetTest
    extend PuppetTest::RunnableTest

    def self.suite
        # Always skip this parent class.  It'd be nice if there were a
        # "supported" way to do this.
        if self == PuppetTest::TestCase
            suite = Test::Unit::TestSuite.new(name)
            return suite
        elsif self.runnable?
            return super
        else
            if defined? $console
                puts "Skipping %s: %s" % [name, @messages.join(", ")]
            end
            suite = Test::Unit::TestSuite.new(name)
            return suite
        end
    end
end