Skip to content

Commit b43874d

Browse files
committed
fix srb / rubocop
1 parent 0d41e76 commit b43874d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

scripts/export_provider_catalog.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,21 @@ def go_string(str)
144144

145145
puts "Wrote provider catalog to #{catalog_path} and #{gen_path}"
146146

147-
def assert(condition, message)
147+
def check(condition, message)
148148
raise message unless condition
149149
end
150150

151151
catalog_data = JSON.parse(File.read(catalog_path))
152152
structs = catalog_data.fetch("structs")
153153

154-
refute_empty(structs, "Struct catalog is empty")
155-
assert(structs.key?("GoodJob"), "Struct catalog missing GoodJob")
154+
check(structs.any?, "Struct catalog is empty")
155+
check(structs.key?("GoodJob"), "Struct catalog missing GoodJob")
156156
good_job = structs["GoodJob"]
157157

158-
assert_includes(good_job["allowed_events"], "enqueue", "GoodJob missing enqueue event")
159-
assert_equal("job", good_job["fixed_source"], "GoodJob fixed source incorrect")
158+
check(good_job["allowed_events"].include?("enqueue"), "GoodJob missing enqueue event")
159+
check(good_job["fixed_source"] == "job", "GoodJob fixed source incorrect")
160160

161161
go_contents = File.read(gen_path)
162162

163-
assert_includes(go_contents, "\"GoodJob\": {Name: \"GoodJob\"", "catalog_gen.go missing GoodJob entry")
164-
assert_includes(go_contents, "AllowedEvents: []string{\"enqueue\"", "catalog_gen.go missing enqueue event")
163+
check(go_contents.include?("\"GoodJob\": {Name: \"GoodJob\""), "catalog_gen.go missing GoodJob entry")
164+
check(go_contents.include?("AllowedEvents: []string{\"enqueue\""), "catalog_gen.go missing enqueue event")

0 commit comments

Comments
 (0)