File: test_coffee_script_processor.rb

package info (click to toggle)
ruby-sprockets 3.7.2-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,456 kB
  • sloc: ruby: 10,879; javascript: 73; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'minitest/autorun'
require 'sprockets/cache'
require 'sprockets/coffee_script_processor'

class TestCoffeeScriptProcessor < Minitest::Test
  def test_compile_coffee_script_template_to_js
    input = {
      content_type: 'application/javascript',
      data: "square = (n) -> n * n",
      cache: Sprockets::Cache.new
    }
    assert Sprockets::CoffeeScriptProcessor.call(input).match(/var square/)
  end

  def test_cache_key
    assert Sprockets::CoffeeScriptProcessor.cache_key
  end
end