You want to test a resource definition (class, defined type) that uses a function provided by a third-party module your module depends upon.
It's supposed that you're implementing your tests with rspec-puppet
.
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
multiline { | |
tags => ["rails"] | |
pattern => "^Started" | |
negate => true | |
what => "previous" | |
} |
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
#!/bin/sh | |
dn='dc=math,dc=nccu,dc=edu,dc=tw' | |
username='jim.yeh' | |
uid='jim.yeh' | |
gid='student' | |
cat << EOF > user_example.ldif | |
dn: cn=$username,ou=users,ou=login,$dn |
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
# | |
# sorted_json.rb | |
# Puppet module for outputting json in a sorted consistent way. I use it for creating config files with puppet | |
require 'json' | |
def sorted_json(json) | |
if (json.kind_of? String) | |
return json.to_json | |
elsif (json.kind_of? Array) |
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
# Calculate a short checksum of the real hostname to determine a unique color | |
if [[ $TERM =~ "256color" ]]; then | |
host_color="38;5;$((16 + $(hostname | cksum | cut -c1-3) % 256))"; | |
else | |
host_color="1;$((31 + $(hostname | cksum | cut -c1-3) % 6))"; | |
fi |
NewerOlder