def make_cucumber_cmd(features_to_run, dirty_features_filename)
return '' if features_to_run == ''
profile_loader = Cucumber::Cli::ProfileLoader.new
profile ||= "autotest-all" if profile_loader.has_profile?("autotest-all") && features_to_run == :all
profile ||= "autotest" if profile_loader.has_profile?("autotest")
profile ||= nil
if profile
args = ["--profile", profile]
else
args = %w{--format} << (features_to_run == :all ? "progress" : "pretty")
end
args += %w{--format rerun --out} << dirty_features_filename
args << (features_to_run == :all ? "" : features_to_run)
unless features_to_run == :all
args << 'features/step_definitions' << 'features/support'
end
args = args.join(' ')
return "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} #{args}"
end