@@ -144,21 +144,21 @@ def go_string(str)
144144
145145puts "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
149149end
150150
151151catalog_data = JSON . parse ( File . read ( catalog_path ) )
152152structs = 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" )
156156good_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
161161go_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