class Fitting::Report::Action

Public Class Methods

new(action) click to toggle source
# File lib/fitting/report/action.rb, line 6
def initialize(action)
  @action = action
  @tests = Fitting::Report::Tests.new([])
  @responses = Fitting::Report::Responses.new(@action.responses)
end

Public Instance Methods

add_test(test) click to toggle source
# File lib/fitting/report/action.rb, line 24
def add_test(test)
  @tests.push(test)
end
details() click to toggle source
# File lib/fitting/report/action.rb, line 45
def details
  {
      tests_without_responses: @tests.without_responses,
      responses_details: @responses.to_a.map { |r| {method: r.status, tests_size: r.tests.size, json_schema: r.id, combinations: r.details} }
  }
end
method() click to toggle source
# File lib/fitting/report/action.rb, line 12
def method
  @action.method
end
path() click to toggle source
# File lib/fitting/report/action.rb, line 16
def path
  @action.path.to_s
end
path_match(find_path) click to toggle source
# File lib/fitting/report/action.rb, line 28
def path_match(find_path)
  regexp =~ find_path
end
regexp() click to toggle source
# File lib/fitting/report/action.rb, line 32
def regexp
  return @regexp if @regexp

  str = Regexp.escape(path)
  str = str.gsub(/\\{\w+\\}/, '[^&=\/]+')
  str = "\\A#{str}\\z"
  @regexp = Regexp.new(str)
end
responses() click to toggle source
# File lib/fitting/report/action.rb, line 20
def responses
  @responses
end
tests() click to toggle source
# File lib/fitting/report/action.rb, line 41
def tests
  @tests
end