Sha256: 1a0c834551ad89d6904f2f28b44da9f60d65f416a3fa6a6dcc68aa02b6fbc199

Contents?: true

Size: 897 Bytes

Versions: 73

Compression:

Stored size: 897 Bytes

Contents

require 'erb'
require File.expand_path('../simple', __FILE__)
require File.expand_path('../quoted', __FILE__)
require File.expand_path('../inline_block', __FILE__)

describe "ERB files" do
  before :each do
    @simple = Template['opal/stdlib/erb/simple']
    @quoted = Template['opal/stdlib/erb/quoted']
    @inline_block = Template['opal/stdlib/erb/inline_block']
  end

  it "should be defined by their filename on Template namespace" do
    @simple.should be_kind_of(Template)
  end

  it "calling the block with a context should render the block" do
    @some_data = "hello"
    @simple.render(self).should == "<div>hello</div>\n"
  end

  it "should accept quotes in strings" do
    @name = "adam"
    @quoted.render(self).should == "<div class=\"foo\">hello there adam</div>\n"
  end

  it "should be able to handle inline blocks" do
    @inline_block.should be_kind_of(Template)
  end
end

Version data entries

73 entries across 73 versions & 3 rubygems

Version Path
opal-1.8.3.rc1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.8.2 spec/opal/stdlib/erb/erb_spec.rb
opal-1.8.1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.8.0 spec/opal/stdlib/erb/erb_spec.rb
opal-1.8.0.beta1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.7.4 spec/opal/stdlib/erb/erb_spec.rb
opal-1.8.0.alpha1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.7.3 spec/opal/stdlib/erb/erb_spec.rb
opal-1.7.2 spec/opal/stdlib/erb/erb_spec.rb
opal-1.7.1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.7.0 spec/opal/stdlib/erb/erb_spec.rb
opal-1.7.0.rc1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.6.1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.6.0 spec/opal/stdlib/erb/erb_spec.rb
opal-1.6.0.rc1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.6.0.alpha1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.5.1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.5.0 spec/opal/stdlib/erb/erb_spec.rb
opal-1.5.0.rc1 spec/opal/stdlib/erb/erb_spec.rb
opal-1.4.1 spec/opal/stdlib/erb/erb_spec.rb