Sha256: 947c76589fb8271ef25708b5c8d742e7f93866b722ac3350c86f41d06e1dc35e

Contents?: true

Size: 529 Bytes

Versions: 7

Compression:

Stored size: 529 Bytes

Contents

# frozen_string_literal: true

require 'ropen_pi/specs/request_factory'
require 'ropen_pi/specs/response_validator'

module RopenPi::Specs::ExampleHelpers
  def submit_request(metadata)
    request = RopenPi::Specs::RequestFactory.new.build_request(metadata, self)
    send(
      request[:verb],
      request[:path],
      params: request[:payload],
      headers: request[:headers]
    )
  end

  def assert_response_matches_metadata(metadata)
    RopenPi::Specs::ResponseValidator.new.validate!(metadata, response)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ropen_pi-0.5.0 lib/ropen_pi/specs/example_helpers.rb
ropen_pi-0.4.0 lib/ropen_pi/specs/example_helpers.rb
ropen_pi-0.3.0 lib/ropen_pi/specs/example_helpers.rb
ropen_pi-0.2.0 lib/ropen_pi/specs/example_helpers.rb
ropen_pi-0.1.2 lib/ropen_pi/specs/example_helpers.rb
ropen_pi-0.1.1 lib/ropen_pi/specs/example_helpers.rb
ropen_pi-0.1.0 lib/ropen_pi/specs/example_helpers.rb