aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/compressors_test.rb
blob: a273f15bd77b91b5f6f592a99b1a808e6f7a853f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'abstract_unit'
require 'sprockets/compressors'

class CompressorsTest < ActiveSupport::TestCase
  def test_register_css_compressor
    Sprockets::Compressors.register_css_compressor(:null, Sprockets::NullCompressor)
    compressor = Sprockets::Compressors.registered_css_compressor(:null)
    assert_kind_of Sprockets::NullCompressor, compressor
  end

  def test_register_js_compressor
    Sprockets::Compressors.register_js_compressor(:uglifier, 'Uglifier', :require => 'uglifier')
    compressor = Sprockets::Compressors.registered_js_compressor(:uglifier)
    assert_kind_of Uglifier, compressor
  end

  def test_register_default_css_compressor
    Sprockets::Compressors.register_css_compressor(:null, Sprockets::NullCompressor, :default => true)
    compressor = Sprockets::Compressors.registered_css_compressor(:default)
    assert_kind_of Sprockets::NullCompressor, compressor
  end

  def test_register_default_js_compressor
    Sprockets::Compressors.register_js_compressor(:null, Sprockets::NullCompressor, :default => true)
    compressor = Sprockets::Compressors.registered_js_compressor(:default)
    assert_kind_of Sprockets::NullCompressor, compressor
  end
end