Problem:
If I run ServerSpec(based RSpec) through Rakeusing one of the following commands:
Rakerake specrake spec:allrake spec:<host>bundle exec rake- ...
Rake displays the command executed before stdoutbefore serverpec exits:
/usr/bin/ruby1.9.1
-I/var/lib/gems/1.9.1/gems/rspec-core-3.1.6/lib:/var/lib/gems/1.9.1/gems/rspec-support-3.1.2/lib
/var/lib/gems/1.9.1/gems/rspec-core-3.1.6/exe/rspec
--pattern spec/<host>/\*_spec.rb
If I pass the target node manually RSpeclike this ...
TARGET_HOST=<host> rspec
... the line is NOT displayed .
Question:
How can I prevent the output Rakefrom this line / command?
I use the default Rakefile generated serverspec-init.
require 'rake'
require 'rspec/core/rake_task'
task :spec => 'spec:all'
task :default => :spec
namespace :spec do
targets = []
Dir.glob('./spec/*').each do |dir|
next unless File.directory?(dir)
targets << File.basename(dir)
end
task :all => targets
task :default => :all
targets.each do |target|
desc "Run serverspec tests to #{target}"
RSpec::Core::RakeTask.new(target.to_sym) do |t|
ENV['TARGET_HOST'] = target
t.pattern = "spec/#{target}/*_spec.rb"
end
end
end
source
share