Sha256: da6cd71d2fd62fba86a5b78aab7f9278b76d94e8a42734e2bdcc756f510d7eed

Contents?: true

Size: 1.75 KB

Versions: 5

Compression:

Stored size: 1.75 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe Merb::Generators::PartControllerGenerator do

  before(:each) do
    @generator = Merb::Generators::PartControllerGenerator.new('/tmp', {}, 'Stuff')
  end
  
  it_should_behave_like "namespaced generator"
  
  it "should create a controller" do
    @generator.should create('/tmp/app/parts/stuff_part.rb')
  end
  
  it "should create a view" do
    @generator.should create('/tmp/app/parts/views/stuff_part/index.html.erb')
  end
  
  it "should create a helper" do
    @generator.should create('/tmp/app/helpers/stuff_part_helper.rb')
  end
  
  describe "with rspec" do
    
    it "should create a controller spec"

    it "should create a helper spec" do
      @generator.should create('/tmp/spec/helpers/stuff_part_helper_spec.rb')
    end
    
  end
  
  describe "with test_unit" do
    
    it "should create a controller test"
    
  end
  
  describe "with a namespace" do
    
    before(:each) do
      @generator = Merb::Generators::PartControllerGenerator.new('/tmp', {}, 'John::Monkey::Stuff')
    end
    
    it "should create a controller" do
      @generator.should create('/tmp/app/parts/john/monkey/stuff_part.rb')
    end

    it "should create a view" do
      @generator.should create('/tmp/app/parts/views/john/monkey/stuff_part/index.html.erb')
    end

    it "should create a helper" do
      @generator.should create('/tmp/app/helpers/john/monkey/stuff_part_helper.rb')
    end

    describe "with rspec" do

      it "should create a controller spec"

      it "should create a helper spec" do
        @generator.should create('/tmp/spec/helpers/john/monkey/stuff_part_helper_spec.rb')
      end

    end

    describe "with test_unit" do

      it "should create a controller test"

    end
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
merb-gen-0.9.8 spec/part_controller_spec.rb
merb-gen-0.9.4 spec/part_controller_spec.rb
merb-gen-0.9.5 spec/part_controller_spec.rb
merb-gen-0.9.6 spec/part_controller_spec.rb
merb-gen-0.9.7 spec/part_controller_spec.rb