Sha256: 9b5554e5c764287d363743807c820baeb03c92360afe678421ff29d0a41bad62

Contents?: true

Size: 442 Bytes

Versions: 3

Compression:

Stored size: 442 Bytes

Contents

require 'spec_helper'

describe Hotcell::Commands::Scope do
  def parse source
    Hotcell::Template.parse(source)
  end

  describe '#render' do
    specify { parse(
      '{{ count = 42 }} {{ scope count: count + 8 }}{{ count }}{{ end scope }} {{ count }}'
    ).render.should == '42 50 42' }
    specify { parse(
      '{{! captured = scope }}Hello{{ end scope }} {{ captured }}'
    ).render(reraise: true).should == ' Hello' }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hotcell-0.3.0 spec/lib/hotcell/commands/scope_spec.rb
hotcell-0.2.0 spec/lib/hotcell/commands/scope_spec.rb
hotcell-0.1.0 spec/lib/hotcell/commands/scope_spec.rb