Sha256: 48ea216bc98b8aa1113adc2dadbe07878ea04bd0c558705dd2afd59482d84abc

Contents?: true

Size: 1 KB

Versions: 13

Compression:

Stored size: 1 KB

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'
    command = "node manifest.js #{tmp_dir}"
    success = Dir.chdir DUMMY_PATH do
      silence_stdout_if !ENV['VERBOSE'] do
        system(command)
      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

13 entries across 13 versions & 3 rubygems

Version Path
bootstrap-sass-3.2.0.4 test/node_mincer_test.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/bootstrap-sass-3.3.5.1/test/node_mincer_test.rb
bootstrap-sass-3.3.5.1 test/node_mincer_test.rb
bootstrap-sass-3.3.5 test/node_mincer_test.rb
bootstrap-sass-3.3.4.1 test/node_mincer_test.rb
bootstrap-sass-3.3.3 test/node_mincer_test.rb
bootstrap-sass-3.3.2.1 test/node_mincer_test.rb
bootstrap-sass-3.3.2.0 test/node_mincer_test.rb
bootstrap-sass-backport-3.3.1.0 test/node_mincer_test.rb
bootstrap-sass-3.3.1.0 test/node_mincer_test.rb
bootstrap-sass-3.3.0.1 test/node_mincer_test.rb
bootstrap-sass-3.3.0.0 test/node_mincer_test.rb
bootstrap-sass-backport-3.2.0.2 test/node_mincer_test.rb