Sha256: d9fa759aef46f8a5622f858be7639bd19c897592a73dd3d682ebaec5b5d00a1d

Contents?: true

Size: 908 Bytes

Versions: 6

Compression:

Stored size: 908 Bytes

Contents

require '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
  
  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

  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
merb-gen-1.1.3 spec/part_controller_spec.rb
merb-gen-1.1.2 spec/part_controller_spec.rb
merb-gen-1.1.1 spec/part_controller_spec.rb
merb-gen-1.1.0 spec/part_controller_spec.rb
merb-gen-1.1.0.rc1 spec/part_controller_spec.rb
merb-gen-1.1.0.pre spec/part_controller_spec.rb