Skip to content

Commit 65116da

Browse files
author
Colleen Murphy
committed
Fix acceptance tests for #405
This fixes the acceptance tests by: - Ensuring the fqdn_rand_string spec is passed undef as the second parameter so that the seed is not used as the charset - Ensuring the pw_hash spec is passed the key specifying the type of hash, rather than the value that will be used to generate the password - Expecting puppet to report nil instead of empty string for undef passwords - Removing the fqdn_rand_base64 test because there is no such function
1 parent e43f058 commit 65116da

3 files changed

Lines changed: 4 additions & 64 deletions

File tree

spec/acceptance/fqdn_rand_base64_spec.rb

Lines changed: 0 additions & 60 deletions
This file was deleted.

spec/acceptance/fqdn_rand_string_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
pp = <<-eos
4545
$l = 10
4646
$s = 'seed'
47-
$o = fqdn_rand_string($l, $s)
47+
$o = fqdn_rand_string($l, undef, $s)
4848
notice(inline_template('fqdn_rand_string is <%= @o.inspect %>'))
4949
eos
5050

spec/acceptance/pw_hash_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
describe 'success' do
77
it 'hashes passwords' do
88
pp = <<-EOS
9-
$o = pw_hash('password', 6, 'salt')
9+
$o = pw_hash('password', 'sha-512', 'salt')
1010
notice(inline_template('pw_hash is <%= @o.inspect %>'))
1111
EOS
1212

@@ -17,12 +17,12 @@
1717

1818
it 'returns nil if no password is provided' do
1919
pp = <<-EOS
20-
$o = pw_hash('', 6, 'salt')
20+
$o = pw_hash('', 'sha-512', 'salt')
2121
notice(inline_template('pw_hash is <%= @o.inspect %>'))
2222
EOS
2323

2424
apply_manifest(pp, :catch_failures => true) do |r|
25-
expect(r.stdout).to match(/pw_hash is ""/)
25+
expect(r.stdout).to match(/pw_hash is nil/)
2626
end
2727
end
2828
end

0 commit comments

Comments
 (0)