mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
5f3570ee7a
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
42 lines
1.4 KiB
Ruby
42 lines
1.4 KiB
Ruby
require "inspec/globals"
|
|
require "#{Inspec.src_root}/test/helper"
|
|
require_relative "../../../lib/inspec/resources/ppa"
|
|
|
|
describe Inspec::Resources::PpaRepository do
|
|
|
|
it "checks on ubuntu as name/ppa" do
|
|
resource = MockLoader.new(:ubuntu).load_resource("ppa", "ubuntu-wine/ppa")
|
|
_(resource.exists?).must_equal true
|
|
_(resource.enabled?).must_equal true
|
|
end
|
|
|
|
it "checks on ubuntu as ppa:name/ppa" do
|
|
resource = MockLoader.new(:ubuntu).load_resource("ppa", "ppa:ubuntu-wine/ppa")
|
|
_(resource.exists?).must_equal true
|
|
_(resource.enabled?).must_equal true
|
|
end
|
|
|
|
it "checks on mint as name/ppa" do
|
|
resource = MockLoader.new(:mint18).load_resource("ppa", "ubuntu-wine/ppa")
|
|
_(resource.exists?).must_equal true
|
|
_(resource.enabled?).must_equal true
|
|
end
|
|
|
|
it "checks on mint as ppa:name/ppa" do
|
|
resource = MockLoader.new(:mint18).load_resource("ppa", "ppa:ubuntu-wine/ppa")
|
|
_(resource.exists?).must_equal true
|
|
_(resource.enabled?).must_equal true
|
|
end
|
|
|
|
it "checks on debian as http://name/" do
|
|
resource = MockLoader.new(:debian8).load_resource("ppa", "http://archive.ubuntu.com/ubuntu/")
|
|
_(resource.exists?).must_equal true
|
|
_(resource.enabled?).must_equal true
|
|
end
|
|
|
|
it "checks on unknown os" do
|
|
resource = MockLoader.new(:undefined).load_resource("ppa", "ubuntu-wine/ppa")
|
|
_(resource.exists?).must_equal false
|
|
_(resource.enabled?).must_equal false
|
|
end
|
|
end
|