Sha256: 92f18c41eacd6eb6cb32ee7ef2794c1a16952ae85864d49f88d8332616560bca

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper")

describe JspTemplateEngine do

  context "building a jsp application" do
    before(:all) do
      @project_path = "src/vraptor-scaffold"
      @web_inf = "#{@project_path}/#{Configuration::WEB_INF}"
      @decorators = "#{@web_inf}/decorators"
      @app = "#{@project_path}/#{Configuration::MAIN_SRC}/app"
      AppGenerator.new(@project_path).invoke_all
    end

    after(:all) do
      FileUtils.remove_dir("src")
    end

    it "should create decorators.xml" do
      source = File.join File.dirname(__FILE__), "templates", "decorators-jsp.xml"
      destination = "#{@web_inf}/decorators.xml"
      exists_and_identical?(source, destination)
    end

    it "should create views folder" do
      File.exist?("#{@web_inf}/jsp").should be_true 
    end

    it "should create decorator file" do
      source = "#{JspTemplateEngine.source_root}/main.jsp"
      destination = "#{@decorators}/main.jsp"
      exists_and_identical?(source, destination)
    end

    it "should not create infrastructure folder" do
      File.exist?("#{@app}/infrastructure").should be_false 
    end

    it "should not create path resolver" do
      to = "#{@app}/infrastructure/FreemarkerPathResolver.java"
      File.exist?(to).should be_false
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vraptor-scaffold-0.0.4 spec/lib/generators/app_generator/jsp_template_engine_spec.rb
vraptor-scaffold-0.0.3 spec/lib/generators/app_generator/jsp_template_engine_spec.rb