templates/puppet/Rakefile in opskeleton-0.6.3 vs templates/puppet/Rakefile in opskeleton-0.6.4

- old
+ new

@@ -20,5 +20,31 @@ end require 'puppet-lint/tasks/puppet-lint' PuppetLint.configuration.ignore_paths =['modules/**/*', 'vendor/**/*'] PuppetLint.configuration.send("disable_80chars") + +desc "Run serverspec to all hosts" +task :spec => 'serverspec:all' + +class ServerspecTask < RSpec::Core::RakeTask + + attr_accessor :target + + def spec_command + cmd = super + "env TARGET_HOST=#{target} #{cmd}" + end + +end + +namespace :serverspec do + + %w(<%=@name=>).each do |profile| + ServerspecTask.new(profile.to_sym) do |t| + t.target = profile + t.pattern = "spec/#{profile}/*_spec.rb" + end + end +end + +task :default => 'serverspec:minimal'