4 class NodeMincerTest < Minitest::Test
5 DUMMY_PATH = 'test/dummy_node_mincer'
7 def test_font_helper_without_suffix
8 assert_match %r(url\(['"]?/assets/.*eot['"]?\)), @css
11 def test_font_helper_with_suffix_sharp
12 assert_match %r(url\(['"]?/assets/.*svg#.+['"]?\)), @css
15 def test_font_helper_with_suffix_question
16 assert_match %r(url\(['"]?/assets/.*eot\?.*['"]?\)), @css
20 assert_match %r(url\(['"]?/assets/apple-touch-icon-144-precomposed.*png['"]?\)), @css
24 tmp_dir = File.join GEM_PATH, 'tmp/node-mincer'
25 success = Dir.chdir DUMMY_PATH do
26 silence_stdout_if !ENV['VERBOSE'] do
27 system 'node', 'manifest.js', tmp_dir
30 assert success, 'Node.js Mincer compilation failed'
31 manifest = JSON.parse(File.read("#{tmp_dir}/manifest.json"))
32 css_name = manifest['assets']['application.css']
33 @css = File.read("#{tmp_dir}/#{css_name}")