X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Ffqdn_uuid_spec.rb;h=60df2e47c28675740a31e510499a5873fe1f39d7;hp=a6da6f26aa782402cbd46584e4416b08bf0f3a88;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/spec/functions/fqdn_uuid_spec.rb b/3rdparty/modules/stdlib/spec/functions/fqdn_uuid_spec.rb index a6da6f26a..60df2e47c 100644 --- a/3rdparty/modules/stdlib/spec/functions/fqdn_uuid_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/fqdn_uuid_spec.rb @@ -2,11 +2,15 @@ require 'spec_helper' describe 'fqdn_uuid' do context 'with invalid parameters' do - it { is_expected.to run.with_params.and_raise_error(ArgumentError, %r{No arguments given$}) } + it { is_expected.to run.with_params.and_raise_error(ArgumentError, %r{No arguments given}) } + it { is_expected.to run.with_params('puppetlabs.com', 'google.com').and_raise_error(ArgumentError, %r{Too many arguments given}) } + it { is_expected.to run.with_params({}).and_raise_error(TypeError, %r{no implicit conversion of Hash}) } + it { is_expected.to run.with_params(0).and_raise_error(TypeError, %r{no implicit conversion of Integer}) } end context 'with given string' do it { is_expected.to run.with_params('puppetlabs.com').and_return('9c70320f-6815-5fc5-ab0f-debe68bf764c') } it { is_expected.to run.with_params('google.com').and_return('64ee70a4-8cc1-5d25-abf2-dea6c79a09c8') } + it { is_expected.to run.with_params('0').and_return('6af613b6-569c-5c22-9c37-2ed93f31d3af') } end end