Sha256: 260e5a4dd45a895ef8bd3c5ed355633686ad886ae30cc79df3c5e66923102dd6
Contents?: true
Size: 1.21 KB
Versions: 1
Compression:
Stored size: 1.21 KB
Contents
require 'spec_helper' describe YogiBerra do it "should call the upstream app with the environment" #do # environment = { 'key' => 'value' } # app = lambda { |env| ['response', {}, env] } # stack = YogiBerra::ExceptionMiddleware.new(app) # response = stack.call(environment) # assert_equal ['response', {}, environment], response #end it "deliver an exception raised while calling an upstream app" #do # exception = build_exception # environment = { 'key' => 'value' } # app = lambda do |env| # raise exception # end # begin # stack = YogiBerra::ExceptionMiddleware.new(app) # stack.call(environment) # rescue Exception => raised # assert_equal exception, raised # else # flunk "Didn't raise an exception" # end #end it "should deliver an exception in rack.exception" #do # exception = build_exception # environment = { 'key' => 'value' } # response = [200, {}, ['okay']] # app = lambda do |env| # env['rack.exception'] = exception # response # end # stack = YogiBerra::ExceptionMiddleware.new(app) # actual_response = stack.call(environment) # assert_equal response, actual_response #end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
yogi_berra-0.0.1 | spec/yogi_berra_spec.rb |