Skip to content

Commit

Permalink
Adding a test for loading specific package names.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelclay committed Mar 23, 2011
1 parent 6827e63 commit 3a27862
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/unit/test_packager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def test_package_caching
end

def test_precache_all
Jammit.load_configuration('test/config/assets.yml').reload!
Jammit.packager.precache_all('test/precache', 'http://www.example.com')
assert PRECACHED_FILES == glob('test/precache/*')
assert Zlib::GzipReader.open('test/precache/css_test-datauri.css.gz') {|f| f.read } == File.read('test/fixtures/jammed/css_test-datauri.css')
Expand Down Expand Up @@ -130,4 +131,12 @@ def test_package_helper
FileUtils.rm_rf("test/public/assets")
end

def test_packaging_javascripts_with_package_names
FileUtils.rm_rf("test/public/assets/*")
Jammit.package! :config_file => "test/config/assets.yml", :package_names => [:js_test]
assert File.exists?("test/public/assets/js_test.js")
assert File.read('test/public/assets/js_test.js') == File.read('test/fixtures/jammed/js_test_package_names.js')
FileUtils.rm_rf("test/public/assets")
end

end

0 comments on commit 3a27862

Please sign in to comment.