Class: TestRail::Project
- Inherits:
-
Object
- Object
- TestRail::Project
- Includes:
- InitializeWithApi
- Defined in:
- lib/test_rail/project.rb
Instance Method Summary collapse
-
#find_or_create_suite(args) ⇒ Object
Find or create a suite in this project based on the suite name project.find_or_create_suite( :name => “My Suite” ).
-
#find_suite(args) ⇒ Object
Find a suite in this project based on the suite name project.find_suite( :name => “My Suite” ).
-
#new_suite(args) ⇒ Object
Create a new suite for this project.
-
#suites ⇒ Object
Return a list of suites belonging to this project.
Methods included from InitializeWithApi
Instance Method Details
#find_or_create_suite(args) ⇒ Object
Find or create a suite in this project based on the suite name project.find_or_create_suite( :name => “My Suite” )
33 34 35 36 37 38 39 40 |
# File 'lib/test_rail/project.rb', line 33 def find_or_create_suite( args ) name = args[:name] or raise "Need to provide the name of a suite" suite = self.find_suite( args ) if suite.nil? suite = new_suite( args ) end suite end |
#find_suite(args) ⇒ Object
Find a suite in this project based on the suite name project.find_suite( :name => “My Suite” )
26 27 28 29 |
# File 'lib/test_rail/project.rb', line 26 def find_suite( args ) name = args[:name] or raise "Need to provide the name of a suite" suites.select{ |s| s.name == name }.first end |
#new_suite(args) ⇒ Object
Create a new suite for this project
20 21 22 |
# File 'lib/test_rail/project.rb', line 20 def new_suite( args ) @api.add_suite( args.merge({:project_id => id}) ) end |
#suites ⇒ Object
Return a list of suites belonging to this project
15 16 17 |
# File 'lib/test_rail/project.rb', line 15 def suites @api.get_suites( :project_id => @id ) end |