1363
1363
1364
1364
# Dependency doesn't consider metadata as part of equality checks
1365
1365
# so this allows us to check that the metadata is updated in tests.
1366
- RSpec ::Matchers . define :with_metadata do |expected |
1366
+ RSpec ::Matchers . define :including_metadata do |expected |
1367
1367
match do |actual |
1368
1368
actual == expected && actual . metadata == expected . metadata
1369
1369
end
1370
1370
end
1371
1371
1372
- def contain_exactly_with_metadata ( *expected )
1373
- contain_exactly ( *expected . map { |e | with_metadata ( e ) } )
1372
+ def contain_exactly_including_metadata ( *expected )
1373
+ contain_exactly ( *expected . map { |e | including_metadata ( e ) } )
1374
1374
end
1375
1375
1376
- def eq_with_metadata ( expected_array )
1377
- eq ( expected_array ) . and contain_exactly_with_metadata ( *expected_array )
1376
+ def eq_including_metadata ( expected_array )
1377
+ eq ( expected_array ) . and contain_exactly_including_metadata ( *expected_array )
1378
1378
end
1379
1379
1380
1380
context "for a security update for a locked transitive dependency" do
@@ -1401,7 +1401,7 @@ def eq_with_metadata(expected_array)
1401
1401
1402
1402
it "correctly updates the transitive dependency" do
1403
1403
expect ( checker . send ( :updated_dependencies_after_full_unlock ) ) .
1404
- to eq_with_metadata ( [
1404
+ to eq_including_metadata ( [
1405
1405
Dependabot ::Dependency . new (
1406
1406
name : "@dependabot-fixtures/npm-transitive-dependency" ,
1407
1407
version : "1.0.1" ,
@@ -1443,7 +1443,7 @@ def eq_with_metadata(expected_array)
1443
1443
let ( :registry_listing_url ) { "https://registry.npmjs.org/transitive-dependency-locked-by-intermediate" }
1444
1444
1445
1445
it "correctly updates the transitive dependency" do
1446
- expect ( checker . send ( :updated_dependencies_after_full_unlock ) ) . to eq_with_metadata ( [
1446
+ expect ( checker . send ( :updated_dependencies_after_full_unlock ) ) . to eq_including_metadata ( [
1447
1447
Dependabot ::Dependency . new (
1448
1448
name : "@dependabot-fixtures/npm-transitive-dependency" ,
1449
1449
package_manager : "npm_and_yarn" ,
@@ -1470,7 +1470,7 @@ def eq_with_metadata(expected_array)
1470
1470
let ( :registry_listing_url ) { "https://registry.npmjs.org/transitive-dependency-locked-by-multiple" }
1471
1471
1472
1472
it "correctly updates the transitive dependency" do
1473
- expect ( checker . send ( :updated_dependencies_after_full_unlock ) ) . to contain_exactly_with_metadata (
1473
+ expect ( checker . send ( :updated_dependencies_after_full_unlock ) ) . to contain_exactly_including_metadata (
1474
1474
Dependabot ::Dependency . new (
1475
1475
name : "@dependabot-fixtures/npm-parent-dependency" ,
1476
1476
package_manager : "npm_and_yarn" ,
@@ -1566,7 +1566,7 @@ def eq_with_metadata(expected_array)
1566
1566
end
1567
1567
1568
1568
it "correctly updates the parent dependency and removes the transitive because removal is enabled" do
1569
- expect ( checker . send ( :updated_dependencies_after_full_unlock ) ) . to contain_exactly_with_metadata (
1569
+ expect ( checker . send ( :updated_dependencies_after_full_unlock ) ) . to contain_exactly_including_metadata (
1570
1570
Dependabot ::Dependency . new (
1571
1571
name : "@dependabot-fixtures/npm-transitive-dependency" ,
1572
1572
package_manager : "npm_and_yarn" ,
@@ -1628,7 +1628,7 @@ def eq_with_metadata(expected_array)
1628
1628
end
1629
1629
1630
1630
it "correctly updates the transitive dependency by unlocking the parent" do
1631
- expect ( checker . send ( :updated_dependencies_after_full_unlock ) ) . to eq_with_metadata ( [
1631
+ expect ( checker . send ( :updated_dependencies_after_full_unlock ) ) . to eq_including_metadata ( [
1632
1632
Dependabot ::Dependency . new (
1633
1633
name : "@dependabot-fixtures/npm-transitive-dependency-with-more-versions" ,
1634
1634
package_manager : "npm_and_yarn" ,
0 commit comments