Class: Swiftrail::Testrail::Coverage

Inherits:
Object
  • Object
show all
Defined in:
lib/swiftrail/testrail/coverage.rb

Instance Method Summary collapse

Constructor Details

#initialize(tests_patterns, test_rail_username, test_rail_password, test_rail_base_url) ⇒ Coverage

Returns a new instance of Coverage.



6
7
8
9
10
11
# File 'lib/swiftrail/testrail/coverage.rb', line 6

def initialize(tests_patterns, test_rail_username, test_rail_password, test_rail_base_url)
  @tests_patterns = tests_patterns
  @test_rail_username = test_rail_username
  @test_rail_password = test_rail_password
  @test_rail_base_url = test_rail_base_url
end

Instance Method Details

#coverage_report(run_id) ⇒ Object



13
14
15
16
17
18
# File 'lib/swiftrail/testrail/coverage.rb', line 13

def coverage_report(run_id)
  coverage_results = test_rail_client(run_id).all_tests.each_with_object({}) do |test, hash|
    hash[test] = swift_tests_for_case_id(test.case_id)
  end
  generate_report(coverage_results)
end