Sha256: 6e36b28afc9c06db8acd9c82f8f710c67e34f1cb28d4cd3cb2ca465f39649c27

Contents?: true

Size: 575 Bytes

Versions: 1

Compression:

Stored size: 575 Bytes

Contents

require 'spec_helper'
require 'tilt/opal'

describe Tilt::OpalTemplate do
  
  it "is registered for '.opal' files" do
    Tilt['test.opal'].should eq(Tilt::OpalTemplate)
  end

  it "compiles and evaluates the template on #render" do
    template = Tilt::OpalTemplate.new { |t| "puts 'Hello, World!'\n" }
    template.render.should include(".m$puts('Hello, World!');")
  end

  it "can be rendered more than once" do
    template = Tilt::OpalTemplate.new { |t| "puts 'Hello, World!'\n" }
    3.times { template.render.should include(".m$puts('Hello, World!');") }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-rails-0.0.1.a spec/tilt/opal_spec.rb