Skip to content

Commit

Permalink
add unit test for $update_host
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed Nov 5, 2022
1 parent 7605ac4 commit c5d1c67
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/classes/nextcloud_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
it { is_expected.to contain_class('nextcloud::app_config') }
it { is_expected.to contain_class('nextcloud::cron') }

it { is_expected.to contain_nextcloud__install__distribution('initial install') }

it { is_expected.to contain_file('/opt/nextcloud-data').with_ensure('directory') }
it { is_expected.to contain_file('Create install dir: initial install').with_ensure('directory') }

Expand All @@ -35,6 +37,21 @@
)
}
end
context 'when specifying update_host' do
let(:params) do
{
admin_password: 'secret',
db_password: 'secret',
update_host: 'DOES_NOT_MATCH_FQDN',
version: '20.0.4',
}
end

it { is_expected.to compile }

it { is_expected.not_to contain_nextcloud__install__distribution('initial install') }
it { is_expected.not_to contain_file('Create install dir: initial install').with_ensure('directory') }
end
end
end
end

0 comments on commit c5d1c67

Please sign in to comment.