Sha256: 663e570dc62637492fa3f80d52a64ea3b2e0c459b8ce6b6e75e4a6e0b1949adb

Contents?: true

Size: 823 Bytes

Versions: 12

Compression:

Stored size: 823 Bytes

Contents

require File.expand_path('../../helper', __FILE__)
require 'innate/view/etanni'

describe Etanni = Innate::Etanni do
  it 'renders a simple template' do
    etanni = Etanni.new('Hello, World!')
    etanni.result(self).should == 'Hello, World!'
  end

  it 'allows use of Etanni::SEPARATOR inside interplated code' do
    etanni = Etanni.new('Hello #{@name}')
    @name = "\n#{Etanni::SEPARATOR}\n"
    etanni.result(self).should == "Hello #{@name}"
  end

  it 'fails with SyntaxError or NameError when the SEPARATOR is used inside a template' do
    lambda{
      etanni = Etanni.new("Hello \n#{Etanni::SEPARATOR}\n")
      etanni.result(self)
    }.should.raise NameError

    lambda{
      etanni = Etanni.new("<h1>Hello \n#{Etanni::SEPARATOR}\n</h1>")
      etanni.result(self)
    }.should.raise SyntaxError
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
innate-2023.01.06 spec/innate/etanni.rb
innate-2015.10.28 spec/innate/etanni.rb
innate-2013.02.21 spec/innate/etanni.rb
innate-2013.02 spec/innate/etanni.rb
innate-2012.12 spec/innate/etanni.rb
innate-2012.03 spec/innate/etanni.rb
innate-2011.12 spec/innate/etanni.rb
innate-2011.10 spec/innate/etanni.rb
innate-2011.04 spec/innate/etanni.rb
innate-2011.01 spec/innate/etanni.rb
innate-2010.07 spec/innate/etanni.rb
innate-2010.06.18 spec/innate/etanni.rb