|  | 
| 1262 | 1262 |           indirect_dependency (1.2.3) | 
| 1263 | 1263 | 
 | 
| 1264 | 1264 |       PLATFORMS | 
| 1265 |  | -        #{lockfile_platforms} | 
|  | 1265 | +        #{formatted_lockfile_platforms(*["ruby", generic_local_platform].uniq)} | 
| 1266 | 1266 | 
 | 
| 1267 | 1267 |       DEPENDENCIES | 
| 1268 | 1268 |         direct_dependency | 
|  | 
| 1272 | 1272 |     G | 
| 1273 | 1273 |   end | 
| 1274 | 1274 | 
 | 
| 1275 |  | -  it "auto-heals when the lockfile is missing dependent specs" do | 
| 1276 |  | -    build_repo4 do | 
| 1277 |  | -      build_gem "minitest-bisect", "1.6.0" do |s| | 
| 1278 |  | -        s.add_dependency "path_expander", "~> 1.1" | 
|  | 1275 | +  shared_examples_for "a lockfile missing dependent specs" do | 
|  | 1276 | +    it "auto-heals" do | 
|  | 1277 | +      build_repo4 do | 
|  | 1278 | +        build_gem "minitest-bisect", "1.6.0" do |s| | 
|  | 1279 | +          s.add_dependency "path_expander", "~> 1.1" | 
|  | 1280 | +        end | 
|  | 1281 | + | 
|  | 1282 | +        build_gem "path_expander", "1.1.1" | 
| 1279 | 1283 |       end | 
| 1280 | 1284 | 
 | 
| 1281 |  | -      build_gem "path_expander", "1.1.1" | 
| 1282 |  | -    end | 
|  | 1285 | +      gemfile <<~G | 
|  | 1286 | +        source "#{file_uri_for(gem_repo4)}" | 
|  | 1287 | +        gem "minitest-bisect" | 
|  | 1288 | +      G | 
| 1283 | 1289 | 
 | 
| 1284 |  | -    gemfile <<~G | 
| 1285 |  | -      source "#{file_uri_for(gem_repo4)}" | 
| 1286 |  | -      gem "minitest-bisect" | 
| 1287 |  | -    G | 
|  | 1290 | +      # Corrupt lockfile (completely missing path_expander) | 
|  | 1291 | +      lockfile <<~L | 
|  | 1292 | +        GEM | 
|  | 1293 | +          remote: #{file_uri_for(gem_repo4)}/ | 
|  | 1294 | +          specs: | 
|  | 1295 | +            minitest-bisect (1.6.0) | 
| 1288 | 1296 | 
 | 
| 1289 |  | -    # Corrupt lockfile (completely missing path_expander) | 
| 1290 |  | -    lockfile <<~L | 
| 1291 |  | -      GEM | 
| 1292 |  | -        remote: #{file_uri_for(gem_repo4)}/ | 
| 1293 |  | -        specs: | 
| 1294 |  | -          minitest-bisect (1.6.0) | 
|  | 1297 | +        PLATFORMS | 
|  | 1298 | +          #{platforms} | 
| 1295 | 1299 | 
 | 
| 1296 |  | -      PLATFORMS | 
| 1297 |  | -        #{lockfile_platforms} | 
|  | 1300 | +        DEPENDENCIES | 
|  | 1301 | +          minitest-bisect | 
| 1298 | 1302 | 
 | 
| 1299 |  | -      DEPENDENCIES | 
| 1300 |  | -        minitest-bisect | 
|  | 1303 | +        BUNDLED WITH | 
|  | 1304 | +           #{Bundler::VERSION} | 
|  | 1305 | +      L | 
| 1301 | 1306 | 
 | 
| 1302 |  | -      BUNDLED WITH | 
| 1303 |  | -         #{Bundler::VERSION} | 
| 1304 |  | -    L | 
|  | 1307 | +      cache_gems "minitest-bisect-1.6.0", "path_expander-1.1.1", :gem_repo => gem_repo4 | 
|  | 1308 | +      bundle :install | 
| 1305 | 1309 | 
 | 
| 1306 |  | -    cache_gems "minitest-bisect-1.6.0", "path_expander-1.1.1", :gem_repo => gem_repo4 | 
| 1307 |  | -    bundle :install | 
|  | 1310 | +      expect(lockfile).to eq <<~L | 
|  | 1311 | +        GEM | 
|  | 1312 | +          remote: #{file_uri_for(gem_repo4)}/ | 
|  | 1313 | +          specs: | 
|  | 1314 | +            minitest-bisect (1.6.0) | 
|  | 1315 | +              path_expander (~> 1.1) | 
|  | 1316 | +            path_expander (1.1.1) | 
| 1308 | 1317 | 
 | 
| 1309 |  | -    expect(lockfile).to eq <<~L | 
| 1310 |  | -      GEM | 
| 1311 |  | -        remote: #{file_uri_for(gem_repo4)}/ | 
| 1312 |  | -        specs: | 
| 1313 |  | -          minitest-bisect (1.6.0) | 
| 1314 |  | -            path_expander (~> 1.1) | 
| 1315 |  | -          path_expander (1.1.1) | 
|  | 1318 | +        PLATFORMS | 
|  | 1319 | +          #{platforms} | 
| 1316 | 1320 | 
 | 
| 1317 |  | -      PLATFORMS | 
| 1318 |  | -        #{lockfile_platforms} | 
|  | 1321 | +        DEPENDENCIES | 
|  | 1322 | +          minitest-bisect | 
| 1319 | 1323 | 
 | 
| 1320 |  | -      DEPENDENCIES | 
| 1321 |  | -        minitest-bisect | 
|  | 1324 | +        BUNDLED WITH | 
|  | 1325 | +           #{Bundler::VERSION} | 
|  | 1326 | +      L | 
|  | 1327 | +    end | 
|  | 1328 | +  end | 
| 1322 | 1329 | 
 | 
| 1323 |  | -      BUNDLED WITH | 
| 1324 |  | -         #{Bundler::VERSION} | 
| 1325 |  | -    L | 
|  | 1330 | +  context "with just specific platform" do | 
|  | 1331 | +    let(:platforms) { lockfile_platforms } | 
|  | 1332 | + | 
|  | 1333 | +    it_behaves_like "a lockfile missing dependent specs" | 
|  | 1334 | +  end | 
|  | 1335 | + | 
|  | 1336 | +  context "with both ruby and specific platform" do | 
|  | 1337 | +    let(:platforms) { lockfile_platforms("ruby") } | 
|  | 1338 | + | 
|  | 1339 | +    it_behaves_like "a lockfile missing dependent specs" | 
| 1326 | 1340 |   end | 
| 1327 | 1341 | 
 | 
| 1328 | 1342 |   it "auto-heals when the lockfile is missing specs" do | 
|  | 
0 commit comments