-
Notifications
You must be signed in to change notification settings - Fork 370
Rack tests #303
base: master
Are you sure you want to change the base?
Rack tests #303
Conversation
@ccammilleri, I am having trouble with the PR. Specifically, when I merge it and run serpico as I normally would (i.e. "ruby serpico.rb") it looks to default to the test cases.
|
@BuffaloWill good catch! RACK_ENV must be set. I believe i just checked to see if it wasn't set to 'test' but didnt check if it was empty/not set, thus the behavior you're seeing. For tests to run, the webbrick process and the log outputs was causing tests to hang. The environment check was my way to have the tests run against the app without those process interfering.
In the past I've solved this by defaulting to a RACK_ENV=production for the app unless overridden via cli. lmk if you'd like that done. |
I think I figured out the issue. serpico.rb loads all files in the helper directory as part of the initialization in "require ./server.rb": Line 90 in dd7093e
The file helpers/test_helper.rb is setting the RACK_ENV to 'test' regardless of the environment setting: I tested out adding the following. Worked for both test and prod:
Is that OK as a fix or is there a better approach? |
will build on master and dev branches only.