diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-09-24 18:01:08 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2011-09-24 19:22:13 -0500 |
commit | 038808ba1a6927189c4a11b7b77ba9a724dd5532 (patch) | |
tree | 10a7c62b6cbd7ff4f658a56af87b112fed78721a /actionpack/test/template | |
parent | 6eaa9f0dadc9c4667d2040dd862b97bc92bdaf19 (diff) | |
download | rails-038808ba1a6927189c4a11b7b77ba9a724dd5532.tar.gz rails-038808ba1a6927189c4a11b7b77ba9a724dd5532.tar.bz2 rails-038808ba1a6927189c4a11b7b77ba9a724dd5532.zip |
Add public API for register new js and css compressors for Sprockets
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/compressors_test.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/actionpack/test/template/compressors_test.rb b/actionpack/test/template/compressors_test.rb new file mode 100644 index 0000000000..583a1455ba --- /dev/null +++ b/actionpack/test/template/compressors_test.rb @@ -0,0 +1,29 @@ +require 'abstract_unit' +require 'rails/railtie' +require 'sprockets/railtie' + +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 |