From b3aa3f13beb1b24f6561f8403586a4ade674b24a Mon Sep 17 00:00:00 2001 From: Mark Harrison Date: Thu, 23 Feb 2017 12:54:19 -0500 Subject: Add a spec for apt_package install with quoted options Signed-off-by: Mark Harrison --- spec/unit/provider/package/apt_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb index e14af488ac..a077b2a2a3 100644 --- a/spec/unit/provider/package/apt_spec.rb +++ b/spec/unit/provider/package/apt_spec.rb @@ -291,6 +291,16 @@ mpg123 1.12.1-0ubuntu1 @provider.install_package(["irssi"], ["0.8.12-7"]) end + + it "should run apt-get install with the package name and quotes options if specified" do + expect(@provider).to receive(:shell_out!).with( + "apt-get", "-q", "-y", "--force-yes", "-o", "Dpkg::Options::=--force-confdef", "-o", "Dpkg::Options::=--force-confnew", "install", "irssi=0.8.12-7", + :env => { "DEBIAN_FRONTEND" => "noninteractive" }, + :timeout => @timeout + ) + @new_resource.options('--force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew"') + @provider.install_package(["irssi"], ["0.8.12-7"]) + end end describe resource_klass, "upgrade_package" do -- cgit v1.2.1