@@ -24,42 +24,42 @@ def test_disabled_compression
2424 @compressor = Compressor . new
2525 # Should not compress js.
2626 packed = @compressor . compress_js ( glob ( 'test/fixtures/src/*.js' ) )
27- assert packed == File . read ( 'test/fixtures/jammed/js_test-uncompressed.js' )
27+ assert_equal packed , File . read ( 'test/fixtures/jammed/js_test-uncompressed.js' )
2828 # Nothing should change with jst.
2929 packed = @compressor . compile_jst ( glob ( 'test/fixtures/src/*.jst' ) )
30- assert packed == File . read ( 'test/fixtures/jammed/jst_test.js' )
30+ assert_equal packed , File . read ( 'test/fixtures/jammed/jst_test.js' )
3131 packed = @compressor . compress_css ( glob ( 'test/fixtures/src/*.css' ) )
32- assert packed == File . open ( 'test/fixtures/jammed/css_test-uncompressed.css' , 'rb' ) { |f | f . read }
32+ assert_equal packed , File . open ( 'test/fixtures/jammed/css_test-uncompressed.css' , 'rb' ) { |f | f . read }
3333 end
3434
3535 def test_css_compression
3636 assert Jammit . compress_assets
3737 assert Jammit . gzip_assets
3838 packed = @compressor . compress_css ( glob ( 'test/fixtures/src/*.css' ) )
39- assert packed == File . read ( 'test/fixtures/jammed/css_test.css' )
39+ assert_equal packed , File . read ( 'test/fixtures/jammed/css_test.css' )
4040 end
4141
4242 def test_erb_configuration
4343 Jammit . load_configuration ( 'test/config/assets-erb.yml' )
4444 assert Jammit . compress_assets
4545 packed = @compressor . compress_css ( glob ( 'test/fixtures/src/*.css' ) )
46- assert packed == File . read ( 'test/fixtures/jammed/css_test.css' )
46+ assert_equal packed , File . read ( 'test/fixtures/jammed/css_test.css' )
4747 end
4848
4949 def test_css_configuration
5050 Jammit . load_configuration ( 'test/config/assets-css.yml' )
5151 packed = Compressor . new . compress_css ( glob ( 'test/fixtures/src/*.css' ) )
52- assert packed == File . read ( 'test/fixtures/jammed/css_test-line-break.css' )
52+ assert_equal packed , File . read ( 'test/fixtures/jammed/css_test-line-break.css' )
5353 end
5454
5555 def test_javascript_compression
5656 packed = @compressor . compress_js ( glob ( 'test/fixtures/src/*.js' ) )
57- assert packed == File . read ( 'test/fixtures/jammed/js_test.js' )
57+ assert_equal packed , File . read ( 'test/fixtures/jammed/js_test.js' )
5858 end
5959
6060 def test_jst_compilation
6161 packed = @compressor . compile_jst ( glob ( 'test/fixtures/src/*.jst' ) )
62- assert packed == File . read ( 'test/fixtures/jammed/jst_test.js' )
62+ assert_equal packed , File . read ( 'test/fixtures/jammed/jst_test.js' )
6363 end
6464
6565 def test_environment_specific_configuration
@@ -72,4 +72,11 @@ def test_environment_specific_configuration
7272 ENV [ 'RAILS_ENV' ] = 'test'
7373 end
7474
75+ def test_no_rewrite_relative_paths
76+ Jammit . load_configuration ( 'test/config/assets-no-rewrite-relative-paths.yml' )
77+ assert !Jammit . rewrite_relative_paths
78+ packed = @compressor . compress_css ( glob ( 'test/fixtures/src/*.css' ) )
79+ assert_equal packed , File . read ( 'test/fixtures/jammed/css_test-no-rewrite-relative-paths.css' )
80+ end
81+
7582end
0 commit comments