Sha256: b98fdaa122b5ff617573b003fcbdc739e8ab38149c239decb1e52d45a3ee3215

Contents?: true

Size: 812 Bytes

Versions: 5

Compression:

Stored size: 812 Bytes

Contents

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

describe "Ahc" do

  it "should get css provides" do
    Ahc.css_provides('test_template/template.css').should == ['test.Template']
  end

  it "should return erb template" do
    template = Ahc.get_template('test_template/template.css')
    template.class.should == Erubis::Eruby
  end

  it "should read templates" do
    Ahc.read_templates(['test_template'])
    Ahc.render('test.Template', {"content" => "<div>Content</div>"}).should == "<div class='test'><div>Content</div></div>"
  end

  it "should be able to use css maps" do
    Ahc.read_templates(['test_template'])
    Ahc.set_css_map({"test" => "a"})
    Ahc.render('test.Template', {"content" => "<div>Content</div>"}).should == "<div class='a'><div>Content</div></div>"
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ahc-0.2.7 spec/ahc_spec.rb
ahc-0.2.6 spec/ahc_spec.rb
ahc-0.2.5 spec/ahc_spec.rb
ahc-0.2.4 spec/ahc_spec.rb
ahc-0.2.2 spec/ahc_spec.rb