# Force `autospec` to work.
Autotest::Rspec.send(:define_method, :make_test_cmd) do |files_to_test|
return String.new if files_to_test.empty?
files = files_to_test.keys.flatten.join " "
"#{ruby} -S #{spec_command} #{add_options_if_present} #{files}"
end
class Autotest::Rspec
def spec_command(separator=File::ALT_SEPARATOR)
unless defined? @spec_command
@spec_command = spec_commands.find { |cmd| File.exists? cmd }
raise RspecCommandError,
"No spec command could be found!" if @spec_command.nil?
@spec_command.gsub! File::SEPARATOR, separator unless separator.nil?
end
@spec_command
end
def spec_commands
[
File.expand_path(File.dirname(__FILE__) + "/../../bin/spec"),
File.join(Config::CONFIG["bindir"], "spec")
]
end
end