Created
June 27, 2023 12:47
-
-
Save ccooke/54531e701ca76fea7120ce5a8e4c1afe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class collections::test { | |
# Contains tests of the collections constructs | |
# Define an iterator stack | |
collections::create { 'foo': | |
} | |
# Add a thing for the stack to do: | |
# collections::tap is a defined type that will create a notify resource containing its parameters | |
collections::register_action { 'Test: Add a define': | |
target => 'foo', | |
resource => 'collections::tap', | |
wrapped => true, | |
} | |
# Send four items through the stack | |
# In this case, it will create a 'collections::tap' for each one | |
[1, 2, 3, 4].each |$num| { | |
collections::append { "Add item ${num} to foo": | |
target => 'foo', | |
item => $num, | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment