From 1e1c8b287a95014f91f00776b0e36c2dfa7c2c82 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 11 Jun 2014 13:31:53 -0400 Subject: [PATCH] Add test case to ensure graceful failure on OSX. --- spec/classes/init_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 120b7e8..c5e938a 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -54,4 +54,16 @@ describe 'apt' do it { should contain_file('puppetlabs.list').with_content(/^deb http:\/\/apt.puppetlabs.com precise main$/) } it { should contain_file('puppetlabs.list').with_content(/^deb-src http:\/\/apt.puppetlabs.com precise main$/) } end + + context 'with unsupported osfamily' do + let :facts do + { :osfamily => 'Darwin', } + end + + it do + expect { + should compile + }.to raise_error(Puppet::Error, /This module only works on Debian or derivatives like Ubuntu/) + end + end end -- 2.45.2