documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

Test failure w/ Ruby 1.9.2 #221

Closed dblock closed 8 years ago

dblock commented 12 years ago
  1) Failure:
test_disabled_compression(BrokenConfigurationTest) [/Users/dblock/source/jammit/dblock/test/unit/test_configuration.rb:32]:
<"/* \u00DCn\u00EDc\u272Ade */\n#hello {\n  color: white;\n  background: blue;\n}\n  #hello .world {\n    border: 1px solid red;\n    margin-left: 10px;\n    margin-right: 10px;\n    margin-bottom: 45px;\n    margin-top: 45px;\n  }\n#another {\n  color: white;\n  background: blue;\n}\n  #css .file {\n    border: 1px solid red;\n    margin-left: 10px;\n    margin-right: 10px;\n    margin-bottom: 45px;\n    margin-top: 45px;\n  }\n  #with_images {\n    background: url(../embed/asterisk_yellow.png?101);\n  }\n  #and_relative_paths {\n    background: url(../embed/asterisk_orange.png?101);\n  }\n  #and_real_urls {\n    background: url(http://example.com/image.png);\n  }\n@font-face {\n\tfont-family: 'DroidSansMonoRegular';\n\tsrc: url(../embed/DroidSansMono.eot?101);\n\tsrc: local('Droid Sans Mono Regular'), local('DroidSansMono'), url(../embed/DroidSansMono.ttf?101) format('truetype');\n}\n"> expected but was
<"/* \xC3\x9Cn\xC3\xADc\xE2\x9C\xAAde */\n#hello {\n  color: white;\n  background: blue;\n}\n  #hello .world {\n    border: 1px solid red;\n    margin-left: 10px;\n    margin-right: 10px;\n    margin-bottom: 45px;\n    margin-top: 45px;\n  }\n#another {\n  color: white;\n  background: blue;\n}\n  #css .file {\n    border: 1px solid red;\n    margin-left: 10px;\n    margin-right: 10px;\n    margin-bottom: 45px;\n    margin-top: 45px;\n  }\n  #with_images {\n    background: url(../embed/asterisk_yellow.png?101);\n  }\n  #and_relative_paths {\n    background: url(../embed/asterisk_orange.png?101);\n  }\n  #and_real_urls {\n    background: url(http://example.com/image.png);\n  }\n@font-face {\n\tfont-family: 'DroidSansMonoRegular';\n\tsrc: url(../embed/DroidSansMono.eot?101);\n\tsrc: local('Droid Sans Mono Regular'), local('DroidSansMono'), url(../embed/DroidSansMono.ttf?101) format('truetype');\n}\n">.

As you can see the only difference is the encoding of the file. In Ruby 1.9.2 Jammit will change the output to be UTF-8, which is probably a good thing. Not sure what the best way to fix the test is - the source is unicode and in 1.8.7 it leaves that alone.