Sha256: 5bb55c3a18cff6a617b6b52aa75183f0ae64852858fd117b0d83308a4a5efe9c

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'
require 'blazing/recipe'

describe Blazing::Recipe do

  describe '.init_by_name' do
    before :each do
      class Blazing::Recipe::Dummy < Blazing::Recipe
      end
    end

    it 'initializes the correct recipe' do
      Blazing::Recipe.init_by_name(:dummy).should be_a Blazing::Recipe::Dummy
    end
  end

  describe '.list' do
    it 'retunrs an array of the available recipe classes' do
      Blazing::Recipe.list.first.should be Blazing::Recipe::Dummy
    end
  end

  describe '.parse_gemfile' do

    it 'works when the recipe gems are specified with versions' do
      gemfile = 'spec/support/gemfile_with_versions'
      Blazing::Recipe.parse_gemfile(gemfile).should == ["blazing-passenger", "blazing-rails"]
    end

    it 'works when the recipe gems are specified without' do
      gemfile = 'spec/support/gemfile_without_versions'
      Blazing::Recipe.parse_gemfile(gemfile).should == ["blazing-passenger", "blazing-rails"]
    end

    it 'does not load gems that are commented out' do
      pending
      gemfile = 'spec/support/gemfile_with_comments'
      Blazing::Recipe.parse_gemfile(gemfile).should == ["blazing-passenger"]
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blazing-0.1.3 spec/blazing/recipe_spec.rb
blazing-0.1.2 spec/blazing/recipe_spec.rb
blazing-0.1.1 spec/blazing/recipe_spec.rb