File: lint.rb

package info (click to toggle)
ruby-inherited-resources 1.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 824 kB
  • sloc: ruby: 4,388; makefile: 6
file content (17 lines) | stat: -rw-r--r-- 553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require "minitest"

class GemfilesTest < Minitest::Test
  ["Gemfile", *Dir.glob("test/rails_[5-9][0-9]/Gemfile")].each do |gemfile|
    define_method :"test_#{gemfile}_is_up_to_date" do
      current_lockfile = File.read("#{gemfile}.lock")

      new_lockfile = Bundler.with_original_env do
        `BUNDLE_GEMFILE=#{gemfile} bundle lock --print`
      end

      msg = "Please update #{gemfile}'s lock file with `BUNDLE_GEMFILE=#{gemfile} bundle install` and commit the result"

      assert_equal current_lockfile, new_lockfile, msg
    end
  end
end