Rakefile in serverspec-2.0.0.beta8 vs Rakefile in serverspec-2.0.0.beta9

- old
+ new

@@ -4,9 +4,31 @@ require "octorelease" rescue LoadError end if defined?(RSpec) - RSpec::Core::RakeTask.new('spec') do |t| - t.pattern = 'spec/*/*_spec.rb' + task :spec => 'spec:all' + + namespace :spec do + task :all => [ 'spec:type:all', 'spec:helper', 'spec:unit' ] + + namespace :type do + oses = Dir.glob('spec/type/*').map {|d| File.basename(d)} + + task :all => oses.map {|os| "spec:type:#{os}" } + + oses.each do |os| + RSpec::Core::RakeTask.new(os.to_sym) do |t| + t.pattern = "spec/type/#{os}/*_spec.rb" + end + end + end + + RSpec::Core::RakeTask.new(:helper) do |t| + t.pattern = "spec/helper/*_spec.rb" + end + + RSpec::Core::RakeTask.new(:unit) do |t| + t.pattern = "spec/unit/*_spec.rb" + end end end