Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/parallel_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def bundler_enabled?
current = File.expand_path(Dir.pwd)

until !File.directory?(current) || current == previous
filename = File.join(current, "Gemfile")
filename = File.join(current, "Gemfile.lock")
return true if File.exist?(filename)
current, previous = File.expand_path("..", current), current
end
Expand Down
8 changes: 4 additions & 4 deletions spec/parallel_tests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ def call(count)
end
end

it "is true when there is a Gemfile" do
it "is true when there is a Gemfile.lock" do
use_temporary_directory do
FileUtils.touch("Gemfile")
FileUtils.touch("Gemfile.lock")
expect(ParallelTests.send(:bundler_enabled?)).to eq(true)
end
end

it "is true when there is a Gemfile in the parent directory" do
it "is true when there is a Gemfile.lock in the parent directory" do
use_temporary_directory do
FileUtils.mkdir "nested"
Dir.chdir "nested" do
FileUtils.touch(File.join("..", "Gemfile"))
FileUtils.touch(File.join("..", "Gemfile.lock"))
expect(ParallelTests.send(:bundler_enabled?)).to eq(true)
end
end
Expand Down