Skip to content

Commit

Permalink
Fix environment specification in RSpec recipe
Browse files Browse the repository at this point in the history
ENV['RACK_ENV'] must be set before the application is loaded - required for Sinatra configuration options for specific environments
  • Loading branch information
ZimbiX committed Nov 10, 2015
1 parent 0c69c97 commit 97757af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testing/rspec.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ In your spec file or your spec helper, you can setup `Rack::Test` like this:
require 'rack/test'
require 'rspec'

require File.expand_path '../../my-app.rb', __FILE__

ENV['RACK_ENV'] = 'test'

require File.expand_path '../../my-app.rb', __FILE__

module RSpecMixin
include Rack::Test::Methods
def app() Sinatra::Application end
Expand Down

0 comments on commit 97757af

Please sign in to comment.