Sha256: 3332adea533c2aaf3d78b304dacee31204aed6a250642a2a0075d5444f7e9eb6

Contents?: true

Size: 1.05 KB

Versions: 24

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe RailsWizard::Recipes do
  subject{ RailsWizard::Recipes }
  let(:recipe){ RailsWizard::Recipe.generate("recipe_test", "# Testing", :name => "Test Recipe", :category => "test", :description => "Just a test.")}

  before(:all) do
    RailsWizard::Recipes.add(recipe)
  end

  it '.list_classes should include recipe classes' do
    subject.list_classes.should be_include(recipe)
  end

  it '.list should include recipe keys' do
    subject.list.should be_include('recipe_test')
  end

  describe '.for' do
    it 'should find for a given category' do
      RailsWizard::Recipes.for('test').should be_include('recipe_test')
    end
  end

  it 'should add recipes in a directory with add_from_directory' do
    subject.add_from_directory(File.join(File.dirname(__FILE__), '..', 'test_recipes'))
    subject.list.should include 'test_recipe_in_file'
  end

  describe '.clear' do
    it 'should remove all current recipes' do
      RailsWizard::Recipes.clear
      subject.list.should == []
      subject.categories.should == []
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rails_apps_composer-2.2.40 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.39 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.38 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.37 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.36 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.35 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.34 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.33 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.32 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.31 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.30 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.29 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.28 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.27 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.26 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.25 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.24 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.23 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.22 spec/rails_wizard/recipes_spec.rb
rails_apps_composer-2.2.21 spec/rails_wizard/recipes_spec.rb