Sha256: 7eca256a3ddf192f45f7b05a43bb477c8a4d381bf8fbc160a718b53a3b5c185f

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'
require 'tempfile'

describe Gondler::Gomfile do
  let(:gomfile) { described_class.new(path) }
  let(:file) do
    Tempfile.open('Gomfile').tap do|f|
      f.print(content)
      f.flush
    end
  end
  let(:path) { file.path }
  let(:content) { '' }
  after { file.close! }

  describe '#gom' do
    let(:content) do
      <<-CONTENT
      gom 'github.com/golang/glog'
      CONTENT
    end

    it 'packages should include glog' do
      expect(gomfile.packages).to have(1).package
    end
  end

  describe '#group' do
    let(:content) do
      <<-CONTENT
      group :development, :test do
        gom 'github.com/golang/glog'
      end
      CONTENT
    end

    it 'package group should == development and test' do
      expect(gomfile.packages.first.group).to eq(%w(development test))
    end
  end

  describe '#os' do
    let(:content) do
      <<-CONTENT
      os :darwin, :linux do
        gom 'github.com/golang/glog'
      end
      CONTENT
    end

    it 'package os should == darwin and linux' do
      expect(gomfile.packages.first.os).to eq(%w(darwin linux))
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gondler-0.0.2 spec/gondler/gomfile_spec.rb
gondler-0.0.1 spec/gondler/gomfile_spec.rb