Permalink
Browse files

Merge pull request #605 from jarmo/bug_396

fixes #396
  • Loading branch information...
2 parents d024dc9 + 2ea6f20 commit d7c250aad23cd67233543887ddefa66d82a8417e @justinko justinko committed May 20, 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
@@ -806,6 +806,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
@@ -246,13 +246,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"])
@@ -297,9 +297,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 d7c250a

Please sign in to comment.