Skip to content

Instantly share code, notes, and snippets.

@nogweii
Created January 10, 2013 17:00
Show Gist options
  • Save nogweii/4503787 to your computer and use it in GitHub Desktop.
Save nogweii/4503787 to your computer and use it in GitHub Desktop.
A few tests of puppet's truthy behaviour
$ puppet apply truthy.pp
"0" is truthy!
/Stage[main]//Notify["0" is truthy!]/message: defined 'message' as '"0" is truthy!'
1 is truthy!
/Stage[main]//Notify[1 is truthy!]/message: defined 'message' as '1 is truthy!'
0 is truthy!
/Stage[main]//Notify[0 is truthy!]/message: defined 'message' as '0 is truthy!'
Finished catalog run in 0.17 seconds
if (0) {
notify {'0 is truthy!': }
}
if ('0') {
notify {'"0" is truthy!': }
}
if (1) {
notify {'1 is truthy!': }
}
if (undef) {
notify {'undef is truthy! (unexpected!)': }
}
if (false) {
notify {'false is truthy!...wat': }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment