File: test_ejs_processor.rb

package info (click to toggle)
ruby-sprockets 4.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,964 kB
  • sloc: ruby: 13,014; javascript: 157; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 493 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true
require 'minitest/autorun'
require 'sprockets/cache'
require 'sprockets/ejs_processor'

class TestEjsProcessor < Minitest::Test
  def test_compile_ejs_template_to_js
    input = {
      content_type: 'application/javascript',
      data: "<span>Hello, <%= name %></p>",
      cache: Sprockets::Cache.new
    }
    assert Sprockets::EjsProcessor.call(input).match(/<span>Hello, /)
  end

  def test_cache_key
    assert Sprockets::EjsProcessor.cache_key
  end
end