Sha256: 7a0fabae3dc546e53aa61ee40a8699a6b9707eeb0d11e2a7f5b8248a8b4f2271

Contents?: true

Size: 854 Bytes

Versions: 6

Compression:

Stored size: 854 Bytes

Contents

require 'spec_helper'
require 'natives/gemfile_viewer'

describe Natives::GemfileViewer do
  describe "#packages" do
    it "list all gems specified in gemfile" do
      gemfile_path = File.join(fixture_path, "Gemfile.with_lockfile")
      gemfile = Natives::GemfileViewer.new(gemfile_path)
      expect(gemfile.gem_names).to eq(['curb'])
      # not sure why 'bundler' gem is always excluded from the list
    end

    it "raises error when gemfile does not have lockfile" do
      gemfile_path = File.join(fixture_path, "Gemfile.no_lockfile")
      gemfile = Natives::GemfileViewer.new(gemfile_path)
      expect { gemfile.gem_names }.to raise_error
    end

    it "raises error when failed to list gems in gemfile" do
      gemfile = Natives::GemfileViewer.new("gemfile_not_exist")
      expect { gemfile.gem_names }.to raise_error
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
natives-0.6.2 spec/natives/gemfile_viewer_spec.rb
natives-0.6.1 spec/natives/gemfile_viewer_spec.rb
natives-0.6.0 spec/natives/gemfile_viewer_spec.rb
natives-0.5.5 spec/natives/gemfile_viewer_spec.rb
natives-0.5.4 spec/natives/gemfile_viewer_spec.rb
natives-0.5.3 spec/natives/gemfile_viewer_spec.rb