diff --git a/lib/parallel_tests.rb b/lib/parallel_tests.rb index c97d739b..61a501e7 100644 --- a/lib/parallel_tests.rb +++ b/lib/parallel_tests.rb @@ -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 diff --git a/spec/parallel_tests_spec.rb b/spec/parallel_tests_spec.rb index 13a673c4..2b555094 100644 --- a/spec/parallel_tests_spec.rb +++ b/spec/parallel_tests_spec.rb @@ -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