Created
January 10, 2013 17:00
-
-
Save nogweii/4503787 to your computer and use it in GitHub Desktop.
A few tests of puppet's truthy behaviour
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
$ 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 |
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
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