Sha256: fefb4a13fd5e5d13dfbb7ad3147f3a47907426bd3b277fe630e44578eab876dd

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

module Firebrew::Firefox
  describe Command do
    subject do
      Command.new(self.config, self.executer)
    end
    
    let(:config){Firebrew::Runner.default_config}
    let(:executer){Command::Executer.new}
    
    context 'when the indicated firefox command by the `config[:firefox]` not existed' do
      let(:config){super().merge firefox: 'firefox/not/existed/path'}
      it { expect{subject}.to raise_error(Firebrew::FirefoxCommandError) }
    end
    
    context 'when the indicated command by the `config[:firefox]` was not firefox' do
      let(:executer) do
        double('executer', exec: ['Other program', 0])
      end
      it { expect{subject}.to raise_error(Firebrew::FirefoxCommandError) }
      
      describe 'command status' do
        let(:executer) do
          double('executer', exec: ['Fake Mozilla Firefox', 1])
        end
        it { expect{subject}.to raise_error(Firebrew::FirefoxCommandError) }
      end
    end
    
    describe '#version()' do
      subject { super().version }
      let(:executer) do
        double('executer', exec: ['Mozilla Firefox 30.0', 0])
      end
      it { is_expected.to eq('30.0') }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
firebrew-0.1.3 spec/firebrew/firefox/command_spec.rb
firebrew-0.1.2 spec/firebrew/firefox/command_spec.rb
firebrew-0.1.1 spec/firebrew/firefox/command_spec.rb
firebrew-0.1.0 spec/firebrew/firefox/command_spec.rb