module ActionDispatch::Integration::Runner - actionpack-4.2.3 Documentation

# module ActionDispatch::Integration::Runner

### Public Instance Methods

app() click to toggle source

    # File lib/action_dispatch/testing/integration.rb, line 319
    def app
      @app ||= nil
    end

default_url_options() click to toggle source

    # File lib/action_dispatch/testing/integration.rb, line 375
    def default_url_options
      reset! unless integration_session
      integration_session.default_url_options
    end

default_url_options=(options) click to toggle source

    # File lib/action_dispatch/testing/integration.rb, line 380
    def default_url_options=(options)
      reset! unless integration_session
      integration_session.default_url_options = options
    end

method_missing(sym, *args, &block) click to toggle source

Delegate unhandled messages to the current session instance.

Calls superclass method

    # File lib/action_dispatch/testing/integration.rb, line 390
    def method_missing(sym, *args, &block)
      reset! unless integration_session
      if integration_session.respond_to?(sym)
        integration_session.__send__(sym, *args, &block).tap do
          copy_session_variables!
        end
      else
        super
      end
    end

open_session() { |session| ... } click to toggle source

Open a new session instance. If a block is given, the new session is yielded to the block before being returned.

    session = open_session do |sess|
      sess.extend(CustomAssertions)
    end

By default, a single session is automatically created for you, but you can use this method to open multiple sessions that ought to be tested simultaneously.

    # File lib/action_dispatch/testing/integration.rb, line 360
    def open_session
      dup.tap do |session|
        yield session if block_given?
      end
    end

reset!() click to toggle source

Reset the current session. This is useful for testing multiple sessions in a single test case.

    # File lib/action_dispatch/testing/integration.rb, line 325
    def reset!
      @integration_session = Integration::Session.new(app)
    end

respond_to?(method, include_private = false) click to toggle source
Calls superclass method

    # File lib/action_dispatch/testing/integration.rb, line 385
    def respond_to?(method, include_private = false)
      integration_session.respond_to?(method, include_private) || super
    end

### Private Instance Methods

integration_session() click to toggle source

    # File lib/action_dispatch/testing/integration.rb, line 402
    def integration_session
      @integration_session ||= nil
    end