Sha256: c40343cf8033c76917b6ab32f60597cdf29e4ea990d70cb388b86fe76e27896b

Contents?: true

Size: 527 Bytes

Versions: 1

Compression:

Stored size: 527 Bytes

Contents

require "json"
require "haml"
contexts = JSON.parse(File.read(File.dirname(__FILE__) + "/tests.json"))

locals = {
  :var   => "value",
  :first => "a",
  :last  => "z"
}

contexts.each do |context|
  name = context[0]
  expectations = context[1]
  describe "When handling #{name}," do
    expectations.each do |input, expected|
      it "should render \"#{input}\" as \"#{expected}\"" do
        engine = Haml::Engine.new(input)
        engine.render(Object.new, locals).chomp.should == expected
      end
    end
  end
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
haml-2.2.5 test/haml/spec/ruby_haml_spec.rb