From 0e684d82ea1ad0f5c85b8aa0147ffec39aac8ddd Mon Sep 17 00:00:00 2001 From: Peter Souter Date: Wed, 7 Dec 2016 19:25:03 +0000 Subject: (MODULES-4188) Add FQDN UUID generation function * Generates UUID based on a given FQDN string and the DNS namespace (6ba7b810-9dad-11d1-80b4-00c04fd430c8) --- spec/functions/fqdn_uuid_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 spec/functions/fqdn_uuid_spec.rb (limited to 'spec') 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 -- cgit v1.2.3