Sha256: 79779e98a07d0fd8fc0996095903027eb88b4ee328728d62e2e117f564a96e3f

Contents?: true

Size: 653 Bytes

Versions: 4

Compression:

Stored size: 653 Bytes

Contents

require 'test_helper'
require 'support/kitchen_helper'

require 'chef/knife'
require 'knife-solo/kitchen_command'

class DummyKitchenCommand < Chef::Knife
  include KnifeSolo::KitchenCommand
end

class KitchenCommandTest < TestCase
  include KitchenHelper

  def test_barks_outside_of_the_kitchen
    cmd = command
    cmd.ui.expects(:err).with(regexp_matches(/must be run inside .* kitchen/))
    outside_kitchen do
      assert_exits { cmd.validate_kitchen! }
    end
  end

  def test_runs_when_in_a_kitchen
    in_kitchen do
      command.validate_kitchen!
    end
  end

  def command(*args)
    knife_command(DummyKitchenCommand, *args)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
knife-solo-0.2.0 test/kitchen_command_test.rb
knife-solo-0.2.0.pre1 test/kitchen_command_test.rb
knife-solo-0.1.0 test/kitchen_command_test.rb
knife-solo-0.1.0.pre1 test/kitchen_command_test.rb