Sha256: df0a9ed72ba04d1cbef836c0ec9099f6fa48767065b880cf6d6ed427db545ced

Contents?: true

Size: 1002 Bytes

Versions: 4

Compression:

Stored size: 1002 Bytes

Contents

require 'spec_helper'
require 'set'
require 'stringio'

describe Railblazer::MinimalGemfile do
  describe "#gems" do
    it "should read a flat list of gems" do
      mysql_gemfile = <<-EOF
        gem 'mysql'
        gem 'othergem'
      EOF

      Railblazer::MinimalGemfile.new(StringIO.new(mysql_gemfile)).gems.must_equal %w[mysql othergem].to_set
    end

    it "should detect gems inside of group blocks" do
      mysql_gemfile = <<-EOF
        gem 'mysql'
        group 'development' do
          gem 'othergem'  
        end
      EOF

      Railblazer::MinimalGemfile.new(StringIO.new(mysql_gemfile)).gems.must_equal %w[mysql othergem].to_set
    end

    it "should ignore other methods in the Gemfile" do
      mysql_gemfile = <<-EOF
        gem 'mysql'
        funky_method
      
        group 'development' do
          gem 'othergem'  
        end
      EOF

      Railblazer::MinimalGemfile.new(StringIO.new(mysql_gemfile)).gems.must_equal %w[mysql othergem].to_set
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
railblazer-0.0.4 spec/railblazer/minimal_gemfile_spec.rb
railblazer-0.0.3 spec/railblazer/minimal_gemfile_spec.rb
railblazer-0.0.2 spec/railblazer/minimal_gemfile_spec.rb
railblazer-0.0.1 spec/railblazer/minimal_gemfile_spec.rb