Sha256: 6789cdc5acbe825ada52b02bbe151635274980c0250d46dea2a76457ddeddf8a

Contents?: true

Size: 558 Bytes

Versions: 2

Compression:

Stored size: 558 Bytes

Contents

class TestCase < MiniTest::Unit::TestCase
  def default_test
    super unless self.class == TestCase
  end

  def knife_command(cmd_class, *args)
    cmd_class.load_deps
    command = cmd_class.new(args)
    command.ui.stubs(:msg)
    command.ui.stubs(:err)
    Chef::Config[:verbosity] = 0
    command.configure_chef
    command
  end

  # Assert that the specified command or block raises SystemExit
  def assert_exits(command = nil)
    assert_raises SystemExit do
      if command
        command.run
      else
        yield
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
knife-solo-0.2.0 test/support/test_case.rb
knife-solo-0.2.0.pre1 test/support/test_case.rb