Sha256: 7b8b52a5bff0c2b60287afe2a52a26e865bd07574d96f55954c7a1f222122be3

Contents?: true

Size: 790 Bytes

Versions: 16

Compression:

Stored size: 790 Bytes

Contents

require 'dply/yum'

module Dply
  describe Yum do

    describe ".install" do
      it "installs the missing packages" do
        expect(Yum).to receive(:cmd).with(["yum", "install", "-y", "xyz"])
        expect { Yum.install(["glibc", "xyz"]) }.to raise_error(Error)
      end

      it "doesn't do anything if packages are already installed" do
        expect(Yum).not_to receive(:cmd).with(array_including("yum", "install"))
        Yum.install(["glibc", "bash"])
      end

    end

    describe ".installed?" do
      it "returns true if all pkgs are installed" do
        expect(Yum.installed? ["glibc", "bash"]).to eq(true)
      end

      it "returns false if some pkgs are not installed" do
        expect(Yum.installed? ["glibc", "xyz"]).to eq(false)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dply-0.3.15 spec/dply/yum_spec.rb
dply-0.3.14 spec/dply/yum_spec.rb
dply-0.3.13 spec/dply/yum_spec.rb
dply-0.3.12 spec/dply/yum_spec.rb
dply-0.3.11 spec/dply/yum_spec.rb
dply-0.3.10 spec/dply/yum_spec.rb
dply-0.3.9 spec/dply/yum_spec.rb
dply-0.3.8 spec/dply/yum_spec.rb
dply-0.3.7 spec/dply/yum_spec.rb
dply-0.3.6 spec/dply/yum_spec.rb
dply-0.3.5 spec/dply/yum_spec.rb
dply-0.3.4 spec/dply/yum_spec.rb
dply-0.3.3 spec/dply/yum_spec.rb
dply-0.3.2 spec/dply/yum_spec.rb
dply-0.3.1 spec/dply/yum_spec.rb
dply-0.3.0 spec/dply/yum_spec.rb