Sha256: 106b66155b4be8d67e02ee8b49c53ee5bd252f8ff803cd9cd67b0b58a8f65f6b

Contents?: true

Size: 615 Bytes

Versions: 1

Compression:

Stored size: 615 Bytes

Contents

require 'spec_helper'

describe Opal::Processor do

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

  it "is registered for '.rb' files" do
    Tilt['test.rb'].should eq(Opal::Processor)
  end

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-rails-0.3.5 spec/opal/processor_spec.rb