Sha256: 596877ebbfdd386bc5fabfeb25887e238285b01f930aa7434c8a6b2b734dab8c

Contents?: true

Size: 757 Bytes

Versions: 2

Compression:

Stored size: 757 Bytes

Contents

require 'tester/reporter/status_code_report'
require 'tester/modules/module'
require 'tester/method_case_test'

class Format < Module
  def go definition, report
    super

    definition.methods.each do |method|
      cases = method.request.cases
      cases.each do |format_case|
        response = self.call method, definition, format_case
        test = FormatTest.new response, format_case.payload, definition.bad_request_response, definition.url, method.verb
        self.report.reports.concat test.check
      end
    end

    report.reports == []
  end
end

class FormatTest < MethodCaseTest
    def initialize response, payload, expected_response, url, verb
        super response, payload, expected_response, url, verb, "FormatModule"
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
api-tester-0.0.5 lib/tester/modules/format.rb
api-tester-0.0.4 lib/tester/modules/format.rb