diff options
author | José Valim <jose.valim@gmail.com> | 2011-09-25 04:01:37 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-09-25 04:01:37 -0700 |
commit | ef4d1cebbc0cb4db59cdfca16d74bbf0f68a58f1 (patch) | |
tree | 10a7c62b6cbd7ff4f658a56af87b112fed78721a /actionpack/test/template/compressors_test.rb | |
parent | 6eaa9f0dadc9c4667d2040dd862b97bc92bdaf19 (diff) | |
parent | 038808ba1a6927189c4a11b7b77ba9a724dd5532 (diff) | |
download | rails-ef4d1cebbc0cb4db59cdfca16d74bbf0f68a58f1.tar.gz rails-ef4d1cebbc0cb4db59cdfca16d74bbf0f68a58f1.tar.bz2 rails-ef4d1cebbc0cb4db59cdfca16d74bbf0f68a58f1.zip |
Merge pull request #2246 from guilleiguaran/sprockets-compressors-api
Public API for add new compressors to Sprockets
Diffstat (limited to 'actionpack/test/template/compressors_test.rb')
-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 |