blob: a04b45b1f76b64544f8e789f5cd78c399e6fa5b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/usr/bin/env ruby
require File.expand_path(File.dirname(__FILE__) + '/../../lib/puppettest')
require 'puppettest'
require 'puppet/provider/nameservice'
require 'facter'
class TestNameServiceProvider < Test::Unit::TestCase
include PuppetTest::FileTesting
def test_option
klass = Class.new(Puppet::Provider::NameService)
klass.resource_type = Puppet::Type.type(:user)
val = nil
assert_nothing_raised {
val = klass.option(:home, :flag)
}
assert_nil(val, "Got an option")
assert_nothing_raised {
klass.options :home, :flag => "-d"
}
assert_nothing_raised {
val = klass.option(:home, :flag)
}
assert_equal("-d", val, "Got incorrect option")
end
end
|