Sha256: a10be115ccfff0a680111bfda1310136abaf871e2db1859001d3b2e831908b56

Contents?: true

Size: 891 Bytes

Versions: 7

Compression:

Stored size: 891 Bytes

Contents

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

describe Rhogen::AppGenerator do

  app_name = 'NeatApp'

  it "should complain if no name is specified" do
    lambda {
      @generator = Rhogen::AppGenerator.new('/tmp', {})
    }.should raise_error(::Templater::TooFewArgumentsError)
  end


  it "should generate class_name" do
    @generator = Rhogen::AppGenerator.new('/tmp', {}, 'Class-With-Hyphens')
    @generator.class_name.should == 'ClassWithHyphens'
  end

  before do
    @generator = Rhogen::AppGenerator.new('/tmp', {}, app_name)
  end

  it "should create application.rb, index.erb, and layout.erb files" do
    ['application.rb', 'index.erb', 'layout.erb'].each do |template|
      @generator.should create("/tmp/#{app_name}/#{template}")
    end
  end

  it "should generate valid erb templates" do
    pending "need to figure out how to validate erb"
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rhodes-0.2.1 spec/app_generator_spec.rb
rhodes-0.2.2 spec/app_generator_spec.rb
rhodes-0.2.4 spec/app_generator_spec.rb
rhodes-0.2.3 spec/app_generator_spec.rb
rhodes-0.2.5 spec/app_generator_spec.rb
rhodes-0.2.6 spec/app_generator_spec.rb
rhodes-0.3.0 spec/app_generator_spec.rb