Skip to content

Commit

Permalink
Merge pull request #605 from jarmo/bug_396
Browse files Browse the repository at this point in the history
fixes #396
  • Loading branch information
justinko committed May 20, 2012
2 parents d024dc9 + 2ea6f20 commit d7c250a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/rspec/core/configuration.rb
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions spec/rspec/core/configuration_spec.rb
Expand Up @@ -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"])
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit d7c250a

Please sign in to comment.