1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
# frozen_string_literal: true
require 'spec_helper'
describe 'undef_test::def' do
let(:title) { 'some_undef_test' }
context "with required_attribute => 'some_string'" do
context 'and defaults_to_undef unspecified' do
let(:params) { { required_attribute: 'some_string' } }
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_undef_test__def('some_undef_test').with(required_attribute: 'some_string') }
it { is_expected.to contain_undef_test__def('some_undef_test').without_defaults_to_undef }
end
context 'and defaults_to_undef => :undef' do
let(:params) { { required_attribute: 'some_string', defaults_to_undef: :undef } }
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_undef_test__def('some_undef_test').with(required_attribute: 'some_string') }
it { is_expected.to contain_undef_test__def('some_undef_test').without_defaults_to_undef }
end
end
context 'with required_attribute => :undef' do
context 'and defaults_to_undef unspecified' do
let(:params) { { required_attribute: :undef } }
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_undef_test__def('some_undef_test').without_required_attribute }
it { is_expected.to contain_undef_test__def('some_undef_test').without_defaults_to_undef }
end
context 'and defaults_to_undef => :undef' do
let(:params) { { required_attribute: :undef, defaults_to_undef: :undef } }
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_undef_test__def('some_undef_test').without_required_attribute }
it { is_expected.to contain_undef_test__def('some_undef_test').without_defaults_to_undef }
end
end
end
|