0
- describe "selection of rspec command" do
0
- include AutotestHelper
0
- @rspec_autotest = Rspec.new
0
- it "should try to find the spec command if it exists in ./bin and use it above everything else" do
0
- File.stub!(:exists?).and_return true
0
- spec_path = File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec")
0
- File.should_receive(:exists?).with(spec_path).and_return true
0
- @rspec_autotest.spec_command.should == spec_path
0
- it "should otherwise select the default spec command in gem_dir/bin/spec" do
0
- @rspec_autotest.stub!(:spec_commands).and_return ["/foo/spec"]
0
- Config::CONFIG.stub!(:[]).and_return "/foo"
0
- File.should_receive(:exists?).with("/foo/spec").and_return(true)
0
- @rspec_autotest.spec_command.should == "/foo/spec"
0
- it "should raise an error if no spec command is found at all" do
0
- File.stub!(:exists?).and_return false
0
- @rspec_autotest.spec_command
0
- }.should raise_error(RspecCommandError, "No spec command could be found!")
0
- describe "selection of rspec command (windows compatibility issues)" do
0
- include AutotestHelper
0
- it "should use the ALT_SEPARATOR if it is non-nil" do
0
- @rspec_autotest = Rspec.new
0
- spec_command = File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec")
0
- @rspec_autotest.stub!(:spec_commands).and_return [spec_command]
0
- @rspec_autotest.spec_command(@windows_alt_separator).should == spec_command.gsub('/', @windows_alt_separator)
0
- it "should not use the ALT_SEPATOR if it is nil" do
0
- @windows_alt_separator = nil
0
- @rspec_autotest = Rspec.new
0
- spec_command = File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec")
0
- @rspec_autotest.stub!(:spec_commands).and_return [spec_command]
0
- @rspec_autotest.spec_command.should == spec_command
0
describe "adding spec.opts --options" do
0
@rspec_autotest = Rspec.new
0
@rspec_autotest.stub!(:add_options_if_present).and_return "-O spec/spec.opts"
0
@ruby = @rspec_autotest.ruby
0
- @spec_command = @rspec_autotest.spec_command
0
@options = @rspec_autotest.add_options_if_present
0
:spec => ["file_one", "file_two"]
0
@@ -126,16 +69,9 @@ HERE
0
@files_to_test.stub!(:keys).and_return @files_to_test[:spec]
0
@to_test = @files_to_test.keys.flatten.join ' '
0
- it "should contain the various commands, ordered by preference" do
0
- Rspec.new.spec_commands.should == [
0
- File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec"),
0
- "#{Config::CONFIG['bindir']}/spec"
0
it "should make the apropriate test command" do
0
- @rspec_autotest.make_test_cmd(@files_to_test).should == "#{@ruby} -S #{@
spec_command} #{@options} #{@to_test}"
0
+ @rspec_autotest.make_test_cmd(@files_to_test).should == "#{@ruby} -S #{@
to_test} #{@options}"