Skip to content

Commit

Permalink
Utilize the new describe_on_supported_os method
Browse files Browse the repository at this point in the history
This demonstrates how the new describe_on_supported_os method would
change the templates. This is still a draft PR to rspec-puppet-facts
(voxpupuli/rspec-puppet-facts#132) and this is
to raise awareness.
  • Loading branch information
ekohl committed Aug 9, 2021
1 parent 2381db6 commit 17f9538
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
10 changes: 2 additions & 8 deletions object_templates/class_spec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

require 'spec_helper'

describe '<%= name %>' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }

it { is_expected.to compile }
end
end
describe_on_supported_os '<%= name %>' do
it { is_expected.to compile }
end
10 changes: 2 additions & 8 deletions object_templates/defined_type_spec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@

require 'spec_helper'

describe '<%= name %>' do
describe_on_supported_os '<%= name %>' do
let(:title) { 'namevar' }
let(:params) do
{}
end

on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }

it { is_expected.to compile }
end
end
it { is_expected.to compile }
end

0 comments on commit 17f9538

Please sign in to comment.