Sha256: 16a768402c188fb9766e9aba99de9b8e3e7103a5ea877da7ab2fe549e792f240

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe RdiffSimple do
  describe '#execute' do
    context 'when rdiff-backup is installed' do
      before { mock_rdiff_installed :yes }

      context 'when no arguments are given' do
        before { mock_rdiff_command '', :failed }
        subject { RdiffSimple.execute }

        it { should be_false }
      end

      context 'when arguments are given' do
        before { mock_rdiff_command '--version', :succeeded }
        subject { RdiffSimple.execute('--version') }

        it { should be_true }
      end
    end

    context 'when rdiff-backup is not installed' do
      before { mock_rdiff_installed false }

      it 'should raise an exception' do
        expect { subject.execute('--version') }.to raise_error(RdiffSimple::NotInstalledError)
      end
    end
  end

  describe '#installed?' do
    context 'when rdiff-backup is installed' do
      before { mock_rdiff_installed :yes }

      it { should be_installed }
    end

    context 'when rdiff-backup is not installed' do
      before { mock_rdiff_installed :no }

      it { should_not be_installed }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rdiff-simple-0.0.6 spec/rdiff_simple_spec.rb
rdiff-simple-0.0.5 spec/rdiff_simple_spec.rb