Sha256: 0b6f85901e6cdd5013925c564fc185ba9cdf9ca408c5ac9392df06a780e5631b

Contents?: true

Size: 758 Bytes

Versions: 10

Compression:

Stored size: 758 Bytes

Contents

require 'test_helper'

module HandlebarsAssets
  class SlimbarsTest < Test::Unit::TestCase
    include SprocketsScope
    include CompilerSupport

    def compile_slim(source)
      Slim::Template.new(HandlebarsAssets::Config.slim_options) { source }.render
    end

    def teardown
      HandlebarsAssets::Config.reset!
      HandlebarsAssets::Handlebars.reset!
    end

    def test_render_slim
      root = '/myapp/app/assets/templates'
      file = 'test_render.slimbars'
      scope = make_scope root, file
      source = "p This is {{handlebars}}"

      template = HandlebarsAssets::TiltHandlebars.new(scope.pathname.to_s) { source }

      assert_equal hbs_compiled('test_render', compile_slim(source)), template.render(scope, {})
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
handlebars_assets-0.16 test/handlebars_assets/slimbars_test.rb
handlebars_assets-0.15 test/handlebars_assets/slimbars_test.rb
handlebars_assets-0.14.1 test/handlebars_assets/slimbars_test.rb
handlebars_assets-0.13.0 test/handlebars_assets/slimbars_test.rb
handlebars_assets-0.12.3 test/handlebars_assets/slimbars_test.rb
handlebars_assets-0.12.2 test/handlebars_assets/slimbars_test.rb
handlebars_assets-0.12.1 test/handlebars_assets/slimbars_test.rb
handlebars_assets-0.12.0 test/handlebars_assets/slimbars_test.rb
handlebars_assets-0.11.0 test/handlebars_assets/slimbars_test.rb
handlebars_assets-0.10.0 test/handlebars_assets/slimbars_test.rb