Sha256: f6027bcb9895d4b42d329f92ce9e6ec75c326538a944f8524238fcbbc9266a43

Contents?: true

Size: 878 Bytes

Versions: 12

Compression:

Stored size: 878 Bytes

Contents

require 'spec_helper'
module WLang
  describe Dialect, "render" do

    U = Upcasing
    let(:expected){ "Hello WHO!" }

    it 'works as expected' do
      U.render(hello_tpl).should eq(expected)
    end

    it 'do not eat extra blocks' do
      U.render("Hello ${who}{world}").should eq("Hello WHO{world}")
    end

    it "accepts an optional scope" do
      U.render(hello_tpl, {}).should eq(expected)
    end

    it "accepts multiple scope objects" do
      U.render(hello_tpl, 12, {}).should eq(expected)
    end

    it 'accepts a :to_path object' do
      U.render(hello_path).should eq(expected)
    end

    it 'accepts an IO instance' do
      hello_io{|io| U.render(io)}.should eq(expected)
    end

    it 'supports specifying the buffer' do
      U.render(hello_tpl, {}, []).should eq(["Hello ", "WHO", "!"])
    end

  end # describe Dialect
end # module WLang

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
wlang-3.0.1 spec/unit/dialect/test_render.rb
wlang-3.0.0 spec/unit/dialect/test_render.rb
wlang-2.3.1 spec/unit/dialect/test_render.rb
wlang-2.3.0 spec/unit/dialect/test_render.rb
wlang-2.2.4 spec/unit/dialect/test_render.rb
wlang-2.2.3 spec/unit/dialect/test_render.rb
wlang-2.2.2 spec/unit/dialect/test_render.rb
wlang-2.2.1 spec/unit/dialect/test_render.rb
wlang-2.2.0 spec/unit/dialect/test_render.rb
wlang-2.1.2 spec/unit/dialect/test_render.rb
wlang-2.1.1 spec/unit/dialect/test_render.rb
wlang-2.1.0 spec/unit/dialect/test_render.rb