Sha256: 953e94e825411faad2b4b7be70a985c79aeaf3550a8cbe5af5aada127633f6b2

Contents?: true

Size: 839 Bytes

Versions: 2

Compression:

Stored size: 839 Bytes

Contents

# encoding: utf-8
describe 'Requirements errors' do
  describe 'valid?' do
    it 'sholud return false' do
      expect(Debsacker::Requirements.valid?([])).to be(false)
    end

    it 'should return false if we have no installed packages' do
      allow(File).to receive(:exist?).and_return(true)
      allow(Debsacker::SystemGateway).to receive(:perform_with_exit_code).and_return(false)
      expect(Debsacker::Requirements.valid?(['cow', 'apt'])).to be(false)
    end
  end
end

describe 'Creator errors' do
  context 'when no permissions' do
    it 'can\'t read changelog file' do
      allow(File).to receive(:open).with('debian/changelog','w').and_raise(Errno::EACCES)
      expect(Debsacker::Creator.new(double(generate: '0.9.0'), double(:[] => 'Package')).create).to eq('Can\'t create debian/changelog file...')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
debsacker-0.1.5 spec/debsacker/exceptions_spec.rb
debsacker-0.1.3 spec/debsacker/exceptions_spec.rb