Skip to content

Commit

Permalink
Merge pull request #5236 from chef/lcg/fix-useradd-test-filters
Browse files Browse the repository at this point in the history
fix the useradd test filters
  • Loading branch information
lamont-granquist committed Aug 23, 2016
2 parents aa2fe50 + 9606b6a commit 18a4a9a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/functional/resource/user/useradd_spec.rb
Expand Up @@ -25,10 +25,22 @@ def resource_for_platform(username, run_context)
Chef::Resource.resource_for_node(:user, node).new(username, run_context)
end

# ideally we could somehow pass an array of [ ...::Aix, ...::Linux ] to the
# filter, but we have to pick the right one for the O/S.
def user_provider_filter
case ohai[:os]
when "aix"
Chef::Provider::User::Aix
when "linux"
Chef::Provider::User::Linux
end
end

metadata = {
:unix_only => true,
:requires_root => true,
:not_supported_on_mac_osx => true,
:provider => { :user => user_provider_filter },
}

describe Chef::Provider::User::Useradd, metadata do
Expand Down

0 comments on commit 18a4a9a

Please sign in to comment.