rubocops/cask/url: Fix test expectations; regexp for starts_with?

This commit is contained in:
Issy Long 2023-03-05 16:55:47 +00:00
parent 4791224acf
commit 4e067565dd
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ module RuboCop
hash_node.each_pair do |key_node, value_node| hash_node.each_pair do |key_node, value_node|
next unless key_node.source == "verified" next unless key_node.source == "verified"
next unless value_node.str_type? next unless value_node.str_type?
next unless value_node.source.start_with?("\"https:/", "\"http:/") next unless value_node.source.start_with?(%r{^"https?://})
add_offense( add_offense(
value_node.source_range, value_node.source_range,

View File

@ -38,7 +38,7 @@ describe RuboCop::Cop::Cask::Url do
severity: :convention, severity: :convention,
line: 3, line: 3,
column: 14, column: 14,
source: "verified: \"https://example.com\"", source: "\"https://example.com\"",
}] }]
end end