Sha256: 36bcdacefc0502f384185d7df9fa63fbf3e7a43e171076d93be6a797809b0830

Contents?: true

Size: 940 Bytes

Versions: 4

Compression:

Stored size: 940 Bytes

Contents

require_relative '../spec_helper'

require 'wright/resource/package'

describe Wright::Resource::Package do
  before(:each) do
    @package = Wright::Resource::Package.new('foo')
    @provider = Minitest::Mock.new
    @package.instance_variable_set(:@provider, @provider)
  end

  describe '#installed_versions' do
    it 'should ask the provider for installed versions' do
      @provider.expect(:installed_versions, nil)
      @package.installed_versions
      @provider.verify
    end
  end

  describe '#install' do
    it 'should ask the provider to install the package' do
      @provider.expect(:install, nil)
      @provider.expect(:updated?, true)
      @package.install
      @provider.verify
    end
  end

  describe '#remove' do
    it 'should ask the provider to remove the package' do
      @provider.expect(:remove, nil)
      @provider.expect(:updated?, true)
      @package.remove
      @provider.verify
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wright-0.3.2 spec/resource/package_spec.rb
wright-0.3.1 spec/resource/package_spec.rb
wright-0.3.0 spec/resource/package_spec.rb
wright-0.2.0 spec/resource/package_spec.rb