From 2e2e566467e7cda71f6b5404d356b29afbc35b98 Mon Sep 17 00:00:00 2001 From: Benedikt Braunger Date: Wed, 23 Sep 2020 14:08:09 +0200 Subject: [PATCH] fixing rspec --- spec/classes/storage_spec.rb | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/spec/classes/storage_spec.rb b/spec/classes/storage_spec.rb index 2fb510d..a098fe0 100644 --- a/spec/classes/storage_spec.rb +++ b/spec/classes/storage_spec.rb @@ -5,7 +5,7 @@ it { is_expected.to contain_class('bareos') } end - context 'with autochangers => { test: { changer_command => "foo", changer_device => "/dev/foo", device => "dev01" }}}' do + context 'with autochangers => { test: { changer_command => "foo", changer_device => "/dev/foo", device => "dev01" }}, devices => { dev01: { archive_device => "/mnt/test", media_type => "file" }}}' do let(:params) do { autochangers: { @@ -14,23 +14,9 @@ changer_device: "/dev/foo", device: "dev01", } - } - } - end - it { is_expected.to compile } - it do - is_expected.to contain_bareos__storage__autochanger('test') - .with_changer_command('foo') - .with_changer_device('/dev/foo') - .with_device('dev01') - end - end - - context 'with devices => { test: { archive_device => "/mnt/test", media_type => "file" }}}' do - let(:params) do - { + }, devices: { - test: { + dev01: { archive_device: "/mnt/test", media_type: "file", } @@ -39,7 +25,11 @@ end it { is_expected.to compile } it do - is_expected.to contain_bareos__storage__device('test') + is_expected.to contain_bareos__storage__autochanger('test') + .with_changer_command('foo') + .with_changer_device('/dev/foo') + .with_device('dev01') + is_expected.to contain_bareos__storage__device('dev01') .with_archive_device('/mnt/test') .with_media_type('file') end