rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
542 stars 97 forks source link

Don't run when RACK_ENV is test #101

Closed swanson closed 11 years ago

swanson commented 11 years ago

Maybe I have a misconfiguration but when using rspec (with RACK_ENV set to test in my spec_helper) the following are printed to stdout:

** Building /js/application.js...
** Building /css/application.css...
j15e commented 11 years ago

You mean you are trying to run your app specs and are using asset-pack and this is causing an issue? Need a bit more details plz!

swanson commented 11 years ago

Yes, when I run my app spec (and I am using asset-pack, configured here: https://github.com/swanson/stringer/blob/master/app.rb#L55) it prints those messages to the console. I assume that means asset-pack is running and doing the compression/minification - which I don't want to happen in test.

Here's the spec_helper that sets RACK_ENV to test: https://github.com/swanson/stringer/blob/master/spec/spec_helper.rb

j15e commented 11 years ago

I got a look at it, see https://github.com/swanson/stringer/pull/116 for details.

In short, I don't thinks it is an issue regarding sinatra-assetpack, I think prebuild should occur in test env if configured so (you might want to tests prebuild eh!).

swanson commented 11 years ago

Thanks for your help. Cheers!