Sha256: d296f1fc978dbd114bd8c7e4f4d4b4d09c9966d99fceb0cef1f7c78207b763af

Contents?: true

Size: 761 Bytes

Versions: 1

Compression:

Stored size: 761 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.url, 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

1 entries across 1 versions & 1 rubygems

Version Path
api-tester-0.0.3 lib/tester/modules/format.rb