Sha256: 60c94558940764ce6a45f4bf110f3b7e26274f9fe167e79e8401846c48049b4b
Contents?: true
Size: 1.15 KB
Versions: 37
Compression:
Stored size: 1.15 KB
Contents
# Example of using metadata. Note each call to metadata_set creates a new entry. # metadata_update without a start time will update the latest metadata entry. puts metadata_get() puts metadata_set({ 'setkey' => 1 }) check_expression("#{metadata_all().length} >= 1") check_expression("#{metadata_get()['metadata']} == {\"setkey\"=>1}") puts metadata_get()['metadata'] puts metadata_update({ 'setkey' => 2, 'updatekey' => 3 }) check_expression("#{metadata_get()['metadata']['setkey']} == 2") check_expression("#{metadata_get()['metadata']['updatekey']} == 3") puts metadata_update({ 'setkey' => 4 }) # Ensure updatekey stays check_expression("#{metadata_get()['metadata']['setkey']} == 4") check_expression("#{metadata_get()['metadata']['updatekey']} == 3") check_expression("#{metadata_all().length} >= 1") metadata_input() # Creates a new entry check_expression("#{metadata_all().length} >= 2") wait 2 # Allow time to advance or it's an error metadata_set({ 'new' => 5 }) # Another new entry check_expression("#{metadata_all().length} >= 3") # The first entry is the newest one we created puts metadata_all check_expression("#{metadata_all()[0]['metadata']} == {\"new\"=>5}")
Version data entries
37 entries across 37 versions & 1 rubygems