Skip to content

Commit 3a27862

Browse files
committed
Adding a test for loading specific package names.
1 parent 6827e63 commit 3a27862

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/unit/test_packager.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def test_package_caching
9191
end
9292

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

134+
def test_packaging_javascripts_with_package_names
135+
FileUtils.rm_rf("test/public/assets/*")
136+
Jammit.package! :config_file => "test/config/assets.yml", :package_names => [:js_test]
137+
assert File.exists?("test/public/assets/js_test.js")
138+
assert File.read('test/public/assets/js_test.js') == File.read('test/fixtures/jammed/js_test_package_names.js')
139+
FileUtils.rm_rf("test/public/assets")
140+
end
141+
133142
end

0 commit comments

Comments
 (0)