2019-08-08 20:44:07 +00:00
|
|
|
require "helper"
|
|
|
|
require "inspec/resource"
|
|
|
|
require "inspec/resources/postfix_conf"
|
|
|
|
|
|
|
|
describe "Inspec::Resources::Postfix_Conf" do
|
|
|
|
|
2019-08-08 21:32:19 +00:00
|
|
|
it "Test default parsing of main.cf on Centos 7" do
|
|
|
|
resource = MockLoader.new(:centos7).load_resource("postfix_conf")
|
|
|
|
result = { "test_parameter" => "value", "other_test_param" => "$value" }
|
2019-08-08 20:44:07 +00:00
|
|
|
_(resource.params).must_equal result
|
|
|
|
_(resource.value(%w{test_parameter})).must_equal "value"
|
|
|
|
end
|
2019-09-03 22:22:32 +00:00
|
|
|
|
|
|
|
it "Test default parsing of other.cf on Centos 7" do
|
|
|
|
resource = MockLoader.new(:centos7).load_resource("postfix_conf", "/etc/postfix/other.cf")
|
|
|
|
result = { "test_parameter_other" => "value", "other_test_param_other" => "$value" }
|
|
|
|
_(resource.params).must_equal result
|
|
|
|
_(resource.value(%w{test_parameter_other})).must_equal "value"
|
|
|
|
end
|
2019-08-08 20:44:07 +00:00
|
|
|
end
|