From 98b919f6721ec9dceda0c175861509af00b4001b Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Sat, 3 May 2025 20:48:20 -0400 Subject: [PATCH] shared_audits_spec: use generic JSON values This updates `eol_json_text` to use generic values (instead of values from nodejs) and to omit some unused fields. --- .../Homebrew/test/utils/shared_audits_spec.rb | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Library/Homebrew/test/utils/shared_audits_spec.rb b/Library/Homebrew/test/utils/shared_audits_spec.rb index 0f3badaa35..a4cde2d26d 100644 --- a/Library/Homebrew/test/utils/shared_audits_spec.rb +++ b/Library/Homebrew/test/utils/shared_audits_spec.rb @@ -8,25 +8,21 @@ RSpec.describe SharedAudits do <<~JSON { "schema_version" : "1.0.0", - "generated_at": "2025-05-03T15:47:58+00:00", + "generated_at": "2025-01-02T01:23:45+00:00", "result": { - "name": "22", + "name": "1.2", "codename": null, - "label": "22 (LTS)", - "releaseDate": "2024-04-24", - "isLts": true, - "ltsFrom": "2024-10-29", - "isEoas": false, - "eoasFrom": "2025-10-21", - "isEol": false, - "eolFrom": "2027-04-30", - "isEoes": null, - "eoesFrom": null, - "isMaintained": true, + "label": "1.2", + "releaseDate": "2024-01-01", + "isLts": false, + "ltsFrom": null, + "isEol": true, + "eolFrom": "2025-01-01", + "isMaintained": false, "latest": { - "name": "22.15.0", - "date": "2025-04-23", - "link": "https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V22.md#22.15.0" + "name": "1.0.0", + "date": "2024-01-01", + "link": "https://example.com/1.0.0" } } } @@ -40,10 +36,10 @@ RSpec.describe SharedAudits do end describe "::eol_data" do - it "returns the `isEol` and `eolFrom` values if the product is found" do + it "returns a parsed JSON object if the product is found" do mock_curl_output stdout: eol_json_text - expect(described_class.eol_data("product", "cycle").dig("result", "isEol")).to be(false) - expect(described_class.eol_data("product", "cycle").dig("result", "eolFrom")).to eq("2027-04-30") + expect(described_class.eol_data("product", "cycle").dig("result", "isEol")).to be(true) + expect(described_class.eol_data("product", "cycle").dig("result", "eolFrom")).to eq("2025-01-01") end it "returns nil if the product is not found" do