Sha256: e7be164e080c83a2d012b03558a75f146ec1baa6efedc8241d32b60512f56769

Contents?: true

Size: 868 Bytes

Versions: 22

Compression:

Stored size: 868 Bytes

Contents

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

describe "Template" do
  describe "of string" do
    before(:each) do
      @template_string = "Hello <%= name %>"
    end
    it "should have a method compile on Template class" do
      Template.respond_to?(:compile_string).should == true
    end
    it "should return rendered content" do
      Template.compile_string(@template_string, {:name => "bob"}).should == "Hello bob"
    end
  end
  describe "of file" do
    before(:each) do
      @template_file = ::File.dirname(__FILE__) + "/../fixtures/test_template.erb"
    end
    it "have the method compile_file on the Template class" do
      Template.respond_to?(:compile_file).should == true
    end
    it "return the rendered content into a string" do
      Template.compile_file(@template_file, {:friends => "bob"}).should == "Hello bob"
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
auser-poolparty-1.1.1 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.1.3 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.1.4 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.1.5 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.1.6 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.1.7 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.0 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.1 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.10 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.11 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.12 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.2 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.3 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.4 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.7 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.8 spec/poolparty/poolparty/template_spec.rb
auser-poolparty-1.2.9 spec/poolparty/poolparty/template_spec.rb
fairchild-poolparty-1.1.3 spec/poolparty/poolparty/template_spec.rb
fairchild-poolparty-1.1.4 spec/poolparty/poolparty/template_spec.rb
fairchild-poolparty-1.1.5 spec/poolparty/poolparty/template_spec.rb