-
-
Notifications
You must be signed in to change notification settings - Fork 233
New rake check - compare root url: to filename (without suffix) #1069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
89e3356
50ce203
b9e3750
ee50a18
fa77eda
e2110c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,6 +106,21 @@ | |
| it { expect(subject).to be_kind_of(String) } | ||
| it { expect(subject).to_not match(%r{\Ahttp(s)?://osvdb\.org}) } | ||
| it { expect(subject).not_to be_empty } | ||
|
|
||
| it "has a filename that matches the root of the url field" do | ||
| url = advisory["url"] | ||
|
|
||
| # Extract filename without extension | ||
| filename_root = File.basename(path, ".yml") | ||
|
|
||
| # 5/24/2026: May 9, 2026 is earliest start date with no failed checks. | ||
| start_date = Date.new(2026, 5, 9) | ||
|
jasnow marked this conversation as resolved.
|
||
| # Skip advisories older than start_date and old OSVDB advisories. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is also probably unnecessary, the code reads well. |
||
| if advisory["date"] >= start_date and !filename_root.start_with?("OSVDB") | ||
| expect(url).to include(filename_root), | ||
| "Expected base filename DOES NOT include URL" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "Expected base filename ..." string doesn't do anything here, and should be dropped. |
||
| end | ||
| end | ||
| end | ||
|
|
||
| describe "title" do | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is probably not necessary, the code is pretty clear.