Skip to content

Commit

Permalink
tests: Use on_supported_os for samba::server::ads
Browse files Browse the repository at this point in the history
  • Loading branch information
vStone committed Mar 1, 2022
1 parent 016c93a commit 5fdad8e
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions spec/classes/samba__server__ads_spec.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
require 'spec_helper'

describe 'samba::server::ads', :type => :class do
let( :facts ) { { :osfamily => 'Debian' } }
context "Default config" do
it { should contain_exec('join-active-directory') }
end

context "No join" do
let ( :params ) { { 'perform_join' => false }}
it { should_not contain_exec('join-active-directory') }
end
on_supported_os.each do |os, osfacts|
describe "on #{os}" do
let(:facts) { osfacts }

context "Default config" do
it { should contain_exec('join-active-directory') }
end

context "No join" do
let ( :params ) { { 'perform_join' => false }}
it { should_not contain_exec('join-active-directory') }
end

context "Join 'forced'" do
let ( :params ) { { 'perform_join' => true }}
it { should contain_exec('join-active-directory') }
context "Join 'forced'" do
let ( :params ) { { 'perform_join' => true }}
it { should contain_exec('join-active-directory') }
end
end
end
end

0 comments on commit 5fdad8e

Please sign in to comment.