Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use facter 3 facts during tests #636

Merged
merged 1 commit into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion spec/classes/puppet_agent_service_cron_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'spec_helper'
require 'deep_merge'

describe 'puppet::agent::service::cron' do
on_os_under_test.each do |os, facts|
Expand All @@ -12,7 +13,7 @@
end

let :facts do
facts.merge(ipaddress: '192.0.2.100')
facts.deep_merge(networking: { ip: '192.0.2.100' })
end

describe 'when runmode is not cron' do
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/puppet_agent_service_systemd_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'spec_helper'
require 'deep_merge'

describe 'puppet::agent::service::systemd' do
on_os_under_test.each do |os, facts|
Expand All @@ -15,7 +16,7 @@
end

let :facts do
facts.merge(ipaddress: '192.0.2.100')
facts.deep_merge(networking: { ip: '192.0.2.100' })
end

describe 'when runmode is not systemd' do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def exclude_test_os

# Use the above environment variables to limit the platforms under test
def on_os_under_test
on_supported_os.reject do |os, facts|
on_supported_os(facterversion: '3.0.0').reject do |os, facts|
(only_test_os() && !only_test_os.include?(os)) ||
(exclude_test_os() && exclude_test_os.include?(os))
end
Expand Down