Sha256: 6e825639c2ab74462722e1d05d97a41b162a2f4e5c64db375677763a6917c22d

Contents?: true

Size: 1.32 KB

Versions: 3

Compression:

Stored size: 1.32 KB

Contents

require 'spec_helper'

describe Gondler::Package do
  let(:name) { 'github.com/golang/glog' }
  let(:options) { {} }
  let(:package) { described_class.new(name, options) }

  describe '#os' do
    let(:expected) { %w(linux darwin) }
    subject { package.os }

    context 'with ["linux", "darwin"]' do
      let(:options) { { os: %w(linux darwin) } }

      it { should == expected }
    end

    context 'with "linux darwin"' do
      let(:options) { { os: 'linux darwin' } }

      it { should == expected }
    end
  end

  describe '#installable?' do
    before { Gondler.env.os = 'darwin' }
    after { Gondler.env.reload! }

    subject { package.installable? }

    context 'when os option is nil' do
      it { should be_true }
    end

    context 'when os option is darwin' do
      let(:options) { { os: 'darwin' } }

      it { should be_true }
    end

    context 'when os option is linux' do
      let(:options) { { os: 'linux' } }

      it { should be_false }
    end

    context 'when os option is linux and darwin' do
      let(:options) { { os: 'linux darwin' } }

      it { should be_true }
    end

    context 'when development without' do
      before { Gondler.withouts = %w(development) }
      after { Gondler.withouts = [] }

      let(:options) { { group: 'development' } }

      it { should be_false }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gondler-0.0.3 spec/gondler/package_spec.rb
gondler-0.0.2 spec/gondler/package_spec.rb
gondler-0.0.1 spec/gondler/package_spec.rb