Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
- add dummy data for service class
- remove wrong assert_private from define
  • Loading branch information
rwaffen committed Aug 8, 2022
1 parent 25a2995 commit 38bec49
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 0 additions & 2 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

# Defaults for Global DNS options
networkmanager::enable_global_dns: false
networkmanagerservers: []
Expand All @@ -19,4 +18,3 @@ networkmanager::ensure_service: 'running'
networkmanager::service_name: 'NetworkManager'
networkmanager::enable_service: true
networkmanager::restart_service: ~

2 changes: 0 additions & 2 deletions manifests/dns.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
Optional[String[1]] $connection = undef,
Boolean $notify_daemon = true,
) {
assert_private()

unless $facts['networkmanager_nmcli_path'] {
fail("Did not found NetworkManager command line tool 'nmcli'.")
}
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/networkmanager_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
let(:params) do
{
service_name: 'foobar',
enable: true,
ensure: 'running',
manage: true,
restart: nil,
}
end

it { is_expected.to compile }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/dns_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
dns_options: '',
}
end
let(:pre_condition) { 'include networkmanager' }
let(:pre_condition) { 'class { "networkmanager::service": service_name => "foobar", enable => true, ensure => "running", manage => true, restart => "/bin/foo",}' }

on_supported_os.each do |os, os_facts|
context "on #{os}" do
Expand Down

0 comments on commit 38bec49

Please sign in to comment.