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)


7
8
9
10
11
12
13
# File 'lib/testrail/test_section.rb', line 7

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.



5
6
7
# File 'lib/testrail/test_section.rb', line 5

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/testrail/test_section.rb', line 5

def name
  @name
end

Instance Method Details

#get_or_create_test_case(name) ⇒ Object



15
16
17
# File 'lib/testrail/test_section.rb', line 15

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