Sha256: a6220faa5ac827ff9834c7756989cb7f730698977e0ed19cb3969a9b64f4b538

Contents?: true

Size: 589 Bytes

Versions: 7

Compression:

Stored size: 589 Bytes

Contents

class RackBox

  # represents a rack appliction
  #
  # gives us some helpers on a rack app 
  # like the ability to use the #request 
  # method on it easily
  #
  class App
    attr_accessor :rack_app, :mock_request

    def initialize rack_app
      @rack_app = rack_app
      reset_request
    end

    def reset_request
      @mock_request = Rack::MockRequest.new @rack_app
    end
    alias reset reset_request

    # sessions are sticky!
    #
    # to reset, @rackbox_app.reset
    def request url, options = {}
      RackBox.request @mock_request, url, options
    end
  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
remi-rackbox-1.1.1 lib/rackbox/app.rb
remi-rackbox-1.1.2 lib/rackbox/app.rb
remi-rackbox-1.1.3 lib/rackbox/app.rb
remi-rackbox-1.1.4 lib/rackbox/app.rb
remi-rackbox-1.1.5 lib/rackbox/app.rb
remi-rackbox-1.1.6 lib/rackbox/app.rb
eol_rackbox-1.1.7 lib/rackbox/app.rb