Module: Res

Defined in:
lib/res.rb,
lib/res/ir.rb,
lib/res/config.rb,
lib/res/version.rb,
lib/res/mappings.rb,
lib/res/parsers/junit.rb,
lib/res/reporters/hive.rb,
lib/res/reporters/lion.rb,
lib/res/formatters/rspec.rb,
lib/res/reporters/testmine.rb,
lib/res/parsers/junitcasper.rb,
lib/res/reporters/test_rail.rb,
lib/res/parsers/android_junit.rb,
lib/res/formatters/ruby_cucumber.rb,
lib/res/formatters/ruby_cucumber2.rb

Overview

Res API

Defined Under Namespace

Modules: Formatters, Parsers, Reporters Classes: Config, IR, Mappings

Constant Summary collapse

VERSION =
'1.2.23'

Class Method Summary collapse

Class Method Details

.parse_results(args) ⇒ Object



37
38
39
40
# File 'lib/res.rb', line 37

def self.parse_results(args)
  parser_class = Res.parser_class(args[:parser])
  parser_class.new(args[:file])
end

.parser_class(type) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/res.rb', line 42

def self.parser_class(type)
  case type
    when :junit
      require 'res/parsers/junit'
      Res::Parsers::Junit
    when :junitcasper
      require 'res/parsers/junitcasper'
      Res::Parsers::Junitcasper
    else
      raise "#{type} parser not Implemented"
  end
end

.perf_dataObject



55
56
57
# File 'lib/res.rb', line 55

def self.perf_data
  @data
end

.perf_data=(data) ⇒ Object



59
60
61
# File 'lib/res.rb', line 59

def self.perf_data= data
  @data = data
end

.reporter_class(type) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/res.rb', line 18

def self.reporter_class(type)
  case type
    when :test_rail
      require 'res/reporters/test_rail'
      Res::Reporters::TestRail
    when :hive
      require 'res/reporters/hive'
      Res::Reporters::Hive
    when :testmine
      require 'res/reporters/testmine'
      Res::Reporters::Testmine
    when :lion
      require 'res/reporters/lion'
      Res::Reporters::Lion
    else 
      raise "Invalid Reporter type"
  end
end

.submit_results(args) ⇒ Object

Report Res IR to a test repository or similar



9
10
11
12
13
14
15
16
# File 'lib/res.rb', line 9

def self.submit_results(args)
  reporter_class = Res.reporter_class(args[:reporter])
  reporter = reporter_class.new( args )

  ir = Res::IR.load(args[:ir])

  reporter.submit_results( ir, args )
end