Permalink
Browse files

fixes #396

  • Loading branch information...
1 parent 7eaa1f6 commit 2ea6f200d1a5cfda0b90a48827aff854130fdaac @jarmo committed Apr 23, 2012
Showing with 10 additions and 5 deletions.
  1. +1 −0 lib/rspec/core/configuration.rb
  2. +9 −5 spec/rspec/core/configuration_spec.rb
@@ -770,6 +770,7 @@ def randomize?
def get_files_to_run(paths)
patterns = pattern.split(",")
paths.map do |path|
+ path = path.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
File.directory?(path) ? gather_directories(path, patterns) : extract_location(path)
end.flatten
end
@@ -215,13 +215,13 @@ module RSpec::Core
config.files_to_run.should eq([ "spec/rspec/core/resources/a_bar.rb"])
end
- it "prevents repitition of dir when start of the pattern" do
+ it "prevents repetition of dir when start of the pattern" do
config.pattern = "spec/**/a_spec.rb"
config.files_or_directories_to_run = "spec"
config.files_to_run.should eq(["spec/rspec/core/resources/a_spec.rb"])
end
- it "does not prevent repitition of dir when later of the pattern" do
+ it "does not prevent repetition of dir when later of the pattern" do
config.pattern = "rspec/**/a_spec.rb"
config.files_or_directories_to_run = "spec"
config.files_to_run.should eq(["spec/rspec/core/resources/a_spec.rb"])
@@ -266,9 +266,13 @@ module RSpec::Core
end
it "loads files in Windows" do
- file = "C:\\path\\to\\project\\spec\\sub\\foo_spec.rb"
- config.files_or_directories_to_run = file
- config.files_to_run.should eq([file])
+ config.files_or_directories_to_run = "C:\\path\\to\\project\\spec\\sub\\foo_spec.rb"
+ config.files_to_run.should eq([ "C:/path/to/project/spec/sub/foo_spec.rb"])
+ end
+
+ it "loads files in Windows when directory is specified" do
+ config.files_or_directories_to_run = "spec\\rspec\\core\\resources"
+ config.files_to_run.should eq([ "spec/rspec/core/resources/a_spec.rb"])
end
end

0 comments on commit 2ea6f20

Please sign in to comment.