summaryrefslogtreecommitdiff
path: root/spec/acceptance/pw_hash_spec.rb
diff options
context:
space:
mode:
authorColleen Murphy <colleen@puppetlabs.com>2015-04-10 09:09:46 -0700
committerColleen Murphy <colleen@puppetlabs.com>2015-04-10 09:15:15 -0700
commit65116dafd507c5111044853861f9b10b02c91854 (patch)
tree0084d0bb0dc159f412d09f9301d3f57b66d00f07 /spec/acceptance/pw_hash_spec.rb
parente43f0582960707f8a7ff9f087ca2b521c1797a91 (diff)
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
Diffstat (limited to 'spec/acceptance/pw_hash_spec.rb')
-rw-r--r--spec/acceptance/pw_hash_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/acceptance/pw_hash_spec.rb b/spec/acceptance/pw_hash_spec.rb
index 4768975..eddb782 100644
--- a/spec/acceptance/pw_hash_spec.rb
+++ b/spec/acceptance/pw_hash_spec.rb
@@ -6,7 +6,7 @@ describe 'pw_hash function', :unless => (UNSUPPORTED_PLATFORMS + ['windows', 'Da
describe 'success' do
it 'hashes passwords' do
pp = <<-EOS
- $o = pw_hash('password', 6, 'salt')
+ $o = pw_hash('password', 'sha-512', 'salt')
notice(inline_template('pw_hash is <%= @o.inspect %>'))
EOS
@@ -17,12 +17,12 @@ describe 'pw_hash function', :unless => (UNSUPPORTED_PLATFORMS + ['windows', 'Da
it 'returns nil if no password is provided' do
pp = <<-EOS
- $o = pw_hash('', 6, 'salt')
+ $o = pw_hash('', 'sha-512', 'salt')
notice(inline_template('pw_hash is <%= @o.inspect %>'))
EOS
apply_manifest(pp, :catch_failures => true) do |r|
- expect(r.stdout).to match(/pw_hash is ""/)
+ expect(r.stdout).to match(/pw_hash is nil/)
end
end
end