Sha256: fd09333448705669f53cc9d4986bdc8552e0acaebbcd16fb502ec66457e052e2

Contents?: true

Size: 413 Bytes

Versions: 7

Compression:

Stored size: 413 Bytes

Contents

# frozen_string_literal: true

module ShibRack
  # Handler for headless browser testing, which injects configured attributes
  # into the Rack env before invoking ShibRack::Handler.
  class TestHandler < Handler
    class <<self
      attr_accessor :attributes
    end

    def call(env)
      attrs = TestHandler.attributes || raise('No user attributes were set')
      super(env.merge(attrs))
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shib-rack-0.5.2 lib/shib_rack/test_handler.rb
shib-rack-0.5.1 lib/shib_rack/test_handler.rb
shib-rack-0.5.0 lib/shib_rack/test_handler.rb
shib-rack-0.4.0 lib/shib_rack/test_handler.rb
shib-rack-0.3.0 lib/shib_rack/test_handler.rb
shib-rack-0.2.0 lib/shib_rack/test_handler.rb
shib-rack-0.1.0 lib/shib_rack/test_handler.rb