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-3.1.1 spec/helpers/controller_helpers.rb
exception_handling-3.1.1.pre.tstarck.1 spec/helpers/controller_helpers.rb
exception_handling-3.1.0 spec/helpers/controller_helpers.rb
exception_handling-3.1.0.pre.3 spec/helpers/controller_helpers.rb
exception_handling-3.0.1 spec/helpers/controller_helpers.rb
exception_handling-3.1.0.pre.2 spec/helpers/controller_helpers.rb
exception_handling-3.1.0.pre.tstarck.2 spec/helpers/controller_helpers.rb
exception_handling-3.1.0.pre.tstarck.1 spec/helpers/controller_helpers.rb
exception_handling-3.0.0 spec/helpers/controller_helpers.rb
exception_handling-3.0.0.pre.2 spec/helpers/controller_helpers.rb
exception_handling-2.17.0.pre.tstarck.1 spec/helpers/controller_helpers.rb
exception_handling-2.16.0 spec/helpers/controller_helpers.rb
exception_handling-2.15.0 spec/helpers/controller_helpers.rb
exception_handling-2.14.0 spec/helpers/controller_helpers.rb
exception_handling-2.14.0.pre.gk.1 spec/helpers/controller_helpers.rb
exception_handling-2.14.0.pre.gk.0 spec/helpers/controller_helpers.rb
exception_handling-2.13.0 spec/helpers/controller_helpers.rb
exception_handling-2.13.0.pre.dc.0 spec/helpers/controller_helpers.rb
exception_handling-2.12.0 spec/helpers/controller_helpers.rb
exception_handling-2.12.0.gfaza.1 spec/helpers/controller_helpers.rb