lib/kitchen/rake_tasks.rb in test-kitchen-1.2.1 vs lib/kitchen/rake_tasks.rb in test-kitchen-1.3.0

- old
+ new

@@ -14,13 +14,13 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -require 'rake/tasklib' +require "rake/tasklib" -require 'kitchen' +require "kitchen" module Kitchen # Kitchen Rake task generator. # @@ -37,22 +37,27 @@ define end private + # @return [Config] a Kitchen::Config attr_reader :config + # Generates a test Rake task for each instance and one to test all + # instances in serial. + # + # @api private def define namespace "kitchen" do config.instances.each do |instance| desc "Run #{instance.name} test instance" task instance.name do instance.test(:always) end end desc "Run all test instances" - task "all" => config.instances.map { |i| i.name } + task "all" => config.instances.map(&:name) end end end end