inspec/test/unit/resources/mongodb_conf_test.rb
Vasu1105 607d9a1ebc Removed port property
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-15 20:04:00 +05:30

18 lines
756 B
Ruby

require "helper"
require "inspec/resource"
require "inspec/resources/mongodb_conf"
describe "Inspec::Resources::MongodbConf" do
it "verify mongd.conf config parsing" do
resource = load_resource("mongodb_conf", "/etc/mongod.conf")
_(resource.params["storage"]["dbPath"]).must_equal "/var/lib/mongodb"
_(resource.params["systemLog"]["path"]).must_equal "/var/log/mongodb/mongod.log"
_(resource.params["net"]["port"]).must_equal 27017
end
it "verify mongd.conf config parsing use default configuration file location." do
resource = load_resource("mongodb_conf")
_(resource.params["storage"]["dbPath"]).must_equal "/var/lib/mongodb"
_(resource.params["systemLog"]["path"]).must_equal "/var/log/mongodb/mongod.log"
end
end