summaryrefslogtreecommitdiff
path: root/spec/functions
diff options
context:
space:
mode:
authorPeter Souter <peter.souter+GIT@puppet.com>2016-12-07 19:25:03 +0000
committerPeter Souter <peter.souter+GIT@puppet.com>2016-12-09 01:07:49 +0000
commit0e684d82ea1ad0f5c85b8aa0147ffec39aac8ddd (patch)
treed9e65bb5b7313cb7493e80c209b09e2b47306aec /spec/functions
parent7507af555361b2dcba8ed6189dc54c21e64ea031 (diff)
(MODULES-4188) Add FQDN UUID generation function
* Generates UUID based on a given FQDN string and the DNS namespace (6ba7b810-9dad-11d1-80b4-00c04fd430c8)
Diffstat (limited to 'spec/functions')
-rw-r--r--spec/functions/fqdn_uuid_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/functions/fqdn_uuid_spec.rb b/spec/functions/fqdn_uuid_spec.rb
new file mode 100644
index 0000000..a2d1618
--- /dev/null
+++ b/spec/functions/fqdn_uuid_spec.rb
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe 'fqdn_uuid' do
+
+ context "Invalid parameters" do
+ it { should run.with_params().and_raise_error(ArgumentError, /No arguments given$/) }
+ end
+
+ context "given string" do
+ it { should run.with_params('puppetlabs.com').and_return('9c70320f-6815-5fc5-ab0f-debe68bf764c') }
+ it { should run.with_params('google.com').and_return('64ee70a4-8cc1-5d25-abf2-dea6c79a09c8') }
+ end
+
+end