require 'rake' require 'rspec/core/rake_task' #hosts = %w( # jenkins-slave.ihe-europe.net # ovh1.ihe-europe.net # ovh2.ihe-europe.net # ovh3.ihe-europe.net # ovh4.ihe-europe.net # art-decor.ihe-europe.net # data.ihe-europe.net # vm-server.ihe-europe.net # vm-server2.ihe-europe.net # vm-server3.ihe-europe.net #) hosts = %w( ovh1.ihe-europe.net vm-server.ihe-europe.net vm-server2.ihe-europe.net vm-server3.ihe-europe.net ) task :spec => 'spec:all' task :default => :spec namespace :spec do task :all => hosts.map {|h| 'spec:' + h.split('.')[0] } hosts.each do |host| short_name = host.split('.')[0] desc "Run serverspec to #{host}" RSpec::Core::RakeTask.new(short_name) do |t| ENV['TARGET_HOST'] = host t.pattern = "spec/{#{host}}/*_spec.rb" t.fail_on_error = false end end end