Sha256: a22a898fd94ac38b14844b70db569413acf9ab435923f1067b615a71f0dc9c77

Contents?: true

Size: 947 Bytes

Versions: 4

Compression:

Stored size: 947 Bytes

Contents

require "rack/test"
require "inheritable_accessors/inheritable_hash_accessor"
require "inheritable_accessors/inheritable_option_accessor"
require "serial_spec/request_response/helpers"

module SerialSpec
  module RequestResponse
    extend ActiveSupport::Concern
    include Rack::Test::Methods
    include InheritableAccessors::InheritableHashAccessor
    include InheritableAccessors::InheritableOptionAccessor
    include Helpers

    included do
      inheritable_hash_accessor :request_opts
      inheritable_hash_accessor :request_params
      inheritable_hash_accessor :request_envs

      inheritable_option_accessor :request_path, :request_method, for: :request_opts
    end

    def perform_request!
      env = request_envs.merge(:method => request_method, :params => request_params.to_hash)
      env = current_session.send :env_for, request_path, env

      current_session.send :process_request, request_path, env
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
serial-spec-0.4.1 lib/serial_spec/request_response.rb
serial-spec-0.4.0 lib/serial_spec/request_response.rb
serial-spec-0.3.1 lib/serial_spec/request_response.rb
serial-spec-0.3.0 lib/serial_spec/request_response.rb