Sha256: 00289481cde17555cf9eba21802c293cc4230fdca0c6ef30037c42eb3589c542

Contents?: true

Size: 640 Bytes

Versions: 56

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true

module ControllerHelpers
  DummyController = Struct.new(:complete_request_uri, :request, :session)
  DummyRequest = Struct.new(:env, :parameters, :session_options)

  class DummySession
    def initialize(data)
      @data = data
    end

    def [](key)
      @data[key]
    end

    def []=(key, value)
      @data[key] = value
    end

    def to_hash
      @data
    end
  end

  def create_dummy_controller(env, parameters, session, request_uri)
    request = DummyRequest.new(env, parameters, DummySession.new(session))
    DummyController.new(request_uri, request, DummySession.new(session))
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
exception_handling-2.5.0 test/helpers/controller_helpers.rb
exception_handling-2.5.0.pre.2 test/helpers/controller_helpers.rb
exception_handling-2.5.0.pre.1 test/helpers/controller_helpers.rb
exception_handling-2.4.4.pre.1 test/helpers/controller_helpers.rb
exception_handling-2.4.4 test/helpers/controller_helpers.rb
exception_handling-2.4.3 test/helpers/controller_helpers.rb
exception_handling-2.4.3.pre.2 test/helpers/controller_helpers.rb
exception_handling-2.4.3.pre.1 test/helpers/controller_helpers.rb
exception_handling-2.4.2 test/helpers/controller_helpers.rb
exception_handling-2.4.1 test/helpers/controller_helpers.rb
exception_handling-2.4.0 test/helpers/controller_helpers.rb
exception_handling-2.4.0.pre.2 test/helpers/controller_helpers.rb
exception_handling-2.4.0.pre.1 test/helpers/controller_helpers.rb
exception_handling-3.0.pre.1 test/helpers/controller_helpers.rb
exception_handling-2.3.0 test/helpers/controller_helpers.rb
exception_handling-2.3.0.pre.1 test/helpers/controller_helpers.rb