spec/autotest/rspec_spec.rb in rspec-1.0.8 vs spec/autotest/rspec_spec.rb in rspec-1.1.0
- old
+ new
@@ -37,11 +37,14 @@
end
end
describe Rspec, "rspec_commands" do
it "should contain the various commands, ordered by preference" do
- Rspec.new.spec_commands.should == ["bin/spec", "#{Config::CONFIG['bindir']}/spec"]
+ Rspec.new.spec_commands.should == [
+ File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec"),
+ "#{Config::CONFIG['bindir']}/spec"
+ ]
end
end
describe Rspec, "selection of rspec command" do
include AutotestHelper
@@ -52,12 +55,13 @@
end
it "should try to find the spec command if it exists in ./bin and use it above everything else" do
File.stub!(:exists?).and_return true
- File.should_receive(:exists?).with("bin/spec").and_return true
- @rspec_autotest.spec_command.should == "bin/spec"
+ spec_path = File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec")
+ File.should_receive(:exists?).with(spec_path).and_return true
+ @rspec_autotest.spec_command.should == spec_path
end
it "should otherwise select the default spec command in gem_dir/bin/spec" do
@rspec_autotest.stub!(:spec_commands).and_return ["/foo/spec"]
Config::CONFIG.stub!(:[]).and_return "/foo"
@@ -83,18 +87,20 @@
common_setup
end
it "should use the ALT_SEPARATOR if it is non-nil" do
@rspec_autotest = Rspec.new(@kernel, @posix_separator, @windows_alt_separator)
- @rspec_autotest.stub!(:spec_commands).and_return [File.join('bin', 'spec')]
- @rspec_autotest.spec_command.should == "bin\\spec"
+ spec_command = File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec")
+ @rspec_autotest.stub!(:spec_commands).and_return [spec_command]
+ @rspec_autotest.spec_command.should == spec_command.gsub('/', '\\')
end
it "should not use the ALT_SEPATOR if it is nil" do
@windows_alt_separator = nil
@rspec_autotest = Rspec.new(@kernel, @posix_separator, @windows_alt_separator)
- @rspec_autotest.stub!(:spec_commands).and_return [File.join('bin', 'spec')]
- @rspec_autotest.spec_command.should == "bin/spec"
+ spec_command = File.expand_path("#{File.dirname(__FILE__)}/../../bin/spec")
+ @rspec_autotest.stub!(:spec_commands).and_return [spec_command]
+ @rspec_autotest.spec_command.should == spec_command
end
end
describe Rspec, "adding spec.opts --options" do
before :each do