- else
- should contain_exec("/usr/bin/apt-key adv --keyserver #{param_hash[:key_server]} --recv-keys #{param_hash[:key]}").with({
- "unless" => "/usr/bin/apt-key list | /bin/grep #{param_hash[:key]}",
- "before" => "File[#{title}.list]"
- })
- should_not contain_exec("Add key: #{param_hash[:key]} from content").with({
- "command" => "/bin/echo '#{param_hash[:key_content]}' | /usr/bin/apt-key add -",
- "unless" => "/usr/bin/apt-key list | /bin/grep '#{param_hash[:key]}'",
- "before" => "File[#{title}.list]"
- })
- end
- else
- should_not contain_exec("Add key: #{param_hash[:key]} from content").with({
- "command" => "/bin/echo '#{param_hash[:key_content]}' | /usr/bin/apt-key add -",
- "unless" => "/usr/bin/apt-key list | /bin/grep '#{param_hash[:key]}'",
- "before" => "File[#{title}.list]"
- })
- should_not contain_exec("/usr/bin/apt-key adv --keyserver #{param_hash[:key_server]} --recv-keys #{param_hash[:key]}").with({
- "unless" => "/usr/bin/apt-key list | /bin/grep #{param_hash[:key]}",
- "before" => "File[#{title}.list]"
- })
+ describe 'validation' do
+ context 'no release' do
+ let :facts do
+ {
+ :lsbdistid => 'Debian',
+ :osfamily => 'Debian'
+ }
+ end