lib/kitchen/rake_tasks.rb in test-kitchen-1.23.0 vs lib/kitchen/rake_tasks.rb in test-kitchen-1.23.2

- old
+ new

@@ -51,18 +51,31 @@ # instances in serial. # # @api private def define namespace "kitchen" do + kitchen_commands = %w{create converge setup verify destroy} config.instances.each do |instance| desc "Run #{instance.name} test instance" task instance.name do instance.test(:always) end + + kitchen_commands.each do |cmd| + namespace cmd do + task instance.name do + instance.send(cmd) + end + desc "Run all #{cmd} instances" + task "all" => config.instances.map(&:name) + end + end end desc "Run all test instances" task "all" => config.instances.map(&:name) + + kitchen_commands.each { |cmd| task cmd => "#{cmd}:all" } end end end end