1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/template/compressors_test.rb

28 lines
1.2 KiB
Ruby

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