File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 39
39
expect ( r . stdout ) . to match ( /fqdn_rand_string is "7oDp0KOr1b"/ )
40
40
end
41
41
end
42
+ it 'generates random alphanumeric strings with custom charsets' do
43
+ shell ( "echo fqdn=fakehost.localdomain > '#{ facts_d } /fqdn.txt'" )
44
+ pp = <<-eos
45
+ $l = 10
46
+ $c = '0123456789'
47
+ $o = fqdn_rand_string($l, $c)
48
+ notice(inline_template('fqdn_rand_string is <%= @o.inspect %>'))
49
+ eos
50
+
51
+ apply_manifest ( pp , :catch_failures => true ) do |r |
52
+ expect ( r . stdout ) . to match ( /fqdn_rand_string is "7203048515"/ )
53
+ end
54
+ end
42
55
it 'generates random alphanumeric strings with custom seeds' do
43
56
shell ( "echo fqdn=fakehost.localdomain > '#{ facts_d } /fqdn.txt'" )
44
57
pp = <<-eos
52
65
expect ( r . stdout ) . to match ( /fqdn_rand_string is "3HS4mbuI3E"/ )
53
66
end
54
67
end
68
+ it 'generates random alphanumeric strings with custom charsets and seeds' do
69
+ shell ( "echo fqdn=fakehost.localdomain > '#{ facts_d } /fqdn.txt'" )
70
+ pp = <<-eos
71
+ $l = 10
72
+ $c = '0123456789'
73
+ $s = 'seed'
74
+ $o = fqdn_rand_string($l, $c, $s)
75
+ notice(inline_template('fqdn_rand_string is <%= @o.inspect %>'))
76
+ eos
77
+
78
+ apply_manifest ( pp , :catch_failures => true ) do |r |
79
+ expect ( r . stdout ) . to match ( /fqdn_rand_string is "3104058232"/ )
80
+ end
81
+ end
55
82
end
56
83
describe 'failure' do
57
84
it 'handles improper argument counts'
You can’t perform that action at this time.
0 commit comments