summaryrefslogtreecommitdiffstats
path: root/test/lib/puppettest/testcase.rb
blob: 0ec98846c28c0c6b62d8bf49befe429cb91dbc1a (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
#!/usr/bin/env ruby
require 'puppettest'
require 'puppettest/runnable_test'
require 'test/unit'

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
      puts "Skipping #{name}: #{@messages.join(", ")}" if defined? $console
      suite = Test::Unit::TestSuite.new(name)
      return suite
    end
  end
end