2 describe 'apt', :type => :class do
5 :disable_keys => false,
6 :always_apt_update => false
12 :disable_keys => true,
13 :always_apt_update => true
16 describe "when #{param_set == {} ? "using default" : "specifying"} class parameters" do
18 param_set == {} ? default_params : params
25 let :refresh_only_apt_update do
26 if param_hash[:always_apt_update]
33 it { should include_class("apt::params") }
35 it { should contain_package("python-software-properties") }
38 should create_file("sources.list")\
39 .with_path("/etc/apt/sources.list")\
40 .with_ensure("present")\
47 should create_file("sources.list.d")\
48 .with_path("/etc/apt/sources.list.d")\
49 .with_ensure("directory")\
55 should create_exec("apt_update")\
56 .with_command("/usr/bin/apt-get update")\
57 .with_subscribe(["File[sources.list]", "File[sources.list.d]"])\
58 .with_refreshonly(refresh_only_apt_update)
62 if param_hash[:disable_keys]
63 should create_exec("make-apt-insecure")\
64 .with_command('/bin/echo "APT::Get::AllowUnauthenticated 1;" >> /etc/apt/apt.conf.d/99unauth')\
65 .with_creates('/etc/apt/apt.conf.d/99unauth')
67 should_not create_exec("make-apt-insecure")\
68 .with_command('/bin/echo "APT::Get::AllowUnauthenticated 1;" >> /etc/apt/apt.conf.d/99unauth')\
69 .with_creates('/etc/apt/apt.conf.d/99unauth')