HEX
Server: Apache
System: Windows NT MAGNETO-ARM 10.0 build 22000 (Windows 10) AMD64
User: Michel (0)
PHP: 7.4.7
Disabled: NONE
Upload Files
File: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/request_store-1.5.1/test/test_helper.rb
class RackApp
  attr_reader :last_value, :store_active

  def call(env)
    RequestStore.store[:foo] ||= 0
    RequestStore.store[:foo] += 1
    @last_value = RequestStore.store[:foo]
    @store_active = RequestStore.active?
    raise 'FAIL' if env[:error]

    [200, {}, ["response"]]
  end
end

class RackAppWithConstResponse
  RESPONSE = [200, {}, ["response"]]

  attr_reader :last_value, :store_active

  def call(env)
    RequestStore.store[:foo] ||= 0
    RequestStore.store[:foo] += 1
    @last_value = RequestStore.store[:foo]
    @store_active = RequestStore.active?
    raise 'FAIL' if env[:error]

    RESPONSE
  end
end