Class: TestRail::TestSection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, test_suite:) ⇒ TestSection

Returns a new instance of TestSection.

Raises:

  • (ArgumentError)


21
22
23
24
25
26
27
# File 'lib/testrail/test_section.rb', line 21

def initialize(id:, name:, test_suite:)
  raise(ArgumentError, 'section id nil') if id.nil?
  raise(ArgumentError, 'section name nil') if name.nil?
  @id = id
  @name = name
  @test_suite = test_suite
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



19
20
21
# File 'lib/testrail/test_section.rb', line 19

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



19
20
21
# File 'lib/testrail/test_section.rb', line 19

def name
  @name
end

Instance Method Details

#get_or_create_test_case(name) ⇒ Object



29
30
31
# File 'lib/testrail/test_section.rb', line 29

def get_or_create_test_case(name)
  @test_suite.get_or_create_test_case(section_id: @id, name: name)
end