Skip to content

Commit

Permalink
[no-merge] Fail tests using old fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
brrygrdn committed Mar 26, 2021
1 parent de34d21 commit 6b37a01
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bundler/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,28 @@ def self.bundler_version
end
end

# Move the existing fixture method aside so we can shim in a check for old-style manifest fixtures
alias non_project_fixture fixture

def fixture(*name)
if PackageManagerHelper.use_bundler_2? && name.any? { |folder| %w(gemfiles gemspecs lockfiles).include? folder }
raise "Non-Project Fixture Loaded: '#{File.join(name)}'."
end

non_project_fixture(*name)
end

def bundler_project_dependency_files(project)
project_dependency_files(File.join("bundler#{PackageManagerHelper.bundler_version}", project))

# TODO: Remove this before merging!
rescue StandardError
if PackageManagerHelper.use_bundler_2? && !ENV["CI"]
FileUtils.copy_entry File.join("spec/fixtures/projects/bundler1", project),
File.join("spec/fixtures/projects/bundler2", project)
end

raise
end

RSpec.configure do |config|
Expand Down

0 comments on commit 6b37a01

Please sign in to comment.