Sha256: 9f014e891c190ad968ff2c88b56e30b69569d09dd55c47147dd28dc162dfcd61

Contents?: true

Size: 1003 Bytes

Versions: 16

Compression:

Stored size: 1003 Bytes

Contents

require 'test_helper'
require 'json'

class NodeMincerTest < Minitest::Test
  DUMMY_PATH = 'test/dummy_node_mincer'

  def test_font_helper_without_suffix
    assert_match %r(url\(['"]?/assets/.*eot['"]?\)), @css
  end

  def test_font_helper_with_suffix_sharp
    assert_match %r(url\(['"]?/assets/.*svg#.+['"]?\)), @css
  end

  def test_font_helper_with_suffix_question
    assert_match %r(url\(['"]?/assets/.*eot\?.*['"]?\)), @css
  end

  def test_image_helper
    assert_match %r(url\(['"]?/assets/apple-touch-icon-144-precomposed.*png['"]?\)), @css
  end

  def setup
    tmp_dir = File.join GEM_PATH, 'tmp/node-mincer'
    success = Dir.chdir DUMMY_PATH do
      silence_stdout_if !ENV['VERBOSE'] do
        system 'node', 'manifest.js', tmp_dir
      end
    end
    assert success, 'Node.js Mincer compilation failed'
    manifest = JSON.parse(File.read("#{tmp_dir}/manifest.json"))
    css_name = manifest['assets']['application.css']
    @css = File.read("#{tmp_dir}/#{css_name}")
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
entreprise7pro-bootstrap-sass-3.4.7 test/node_mincer_test.rb
entreprise7pro-bootstrap-sass-3.4.6 test/node_mincer_test.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/node_mincer_test.rb
bootstrap-sass-3.4.1 test/node_mincer_test.rb
bootstrap-sass-3.4.0 test/node_mincer_test.rb
bootstrap-sass-3.3.7 test/node_mincer_test.rb
bootstrap-sass-3.3.6 test/node_mincer_test.rb