Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test against Gemfile.lock to use bundler or not #633

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/parallel_tests.rb
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
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