This behavior is controlled by RSpec :: Core :: RakeTask # fail_on_error , so to continue working on all hosts, you need to add t.fail_on_error = false. I also think you do not need rescue.
namespace :spec do
task :all => hosts.map {|h| 'spec:' + h.split('.')[0] }
hosts.each do |host|
desc "Run serverspec to #{host}"
RSpec::Core::RakeTask.new(host) do |t|
ENV['TARGET_HOST'] = host
t.pattern = "spec/cfengine3/*_spec.rb"
t.fail_on_error = false
end
end
end
source
share