Class: TestRail::Project
- Inherits:
-
Object
- Object
- TestRail::Project
- Includes:
- InitializeWithApi
- Defined in:
- lib/test_rail/project.rb
Instance Method Summary collapse
- #find_or_create_plan(args) ⇒ Object
-
#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_plan(args) ⇒ Object
Find a plan in this project based on the plan name project.find_plan( :name => “My Plan” ).
-
#find_suite(args) ⇒ Object
Find a suite in this project based on the suite name project.find_suite( :name => “My Suite” ).
-
#new_plan(args) ⇒ Object
Create a new plan for this project.
-
#new_suite(args) ⇒ Object
Create a new suite for this project.
-
#plans ⇒ Object
Return a list of plans belonging to this project.
-
#suites ⇒ Object
Return a list of suites belonging to this project.
Methods included from InitializeWithApi
Instance Method Details
#find_or_create_plan(args) ⇒ Object
61 62 63 64 65 66 67 68 |
# File 'lib/test_rail/project.rb', line 61 def find_or_create_plan( args ) name =args[:name] or raise "Need to provide name of plan" plan = self.find_plan( args ) if plan.nil? plan = new_plan( args ) end plan end |
#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” )
52 53 54 55 56 57 58 59 |
# File 'lib/test_rail/project.rb', line 52 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_plan(args) ⇒ Object
Find a plan in this project based on the plan name project.find_plan( :name => “My Plan” )
44 45 46 47 |
# File 'lib/test_rail/project.rb', line 44 def find_plan( args ) name = args[:name] or raise "Need to provide the name of plan" plans.select{ |s| s.name == name }.first end |
#find_suite(args) ⇒ Object
Find a suite in this project based on the suite name project.find_suite( :name => “My Suite” )
32 33 34 35 |
# File 'lib/test_rail/project.rb', line 32 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_plan(args) ⇒ Object
Create a new plan for this project
38 39 40 |
# File 'lib/test_rail/project.rb', line 38 def new_plan( args ) @api.add_plan( args.merge({:project_id => id}) ) end |
#new_suite(args) ⇒ Object
Create a new suite for this project
26 27 28 |
# File 'lib/test_rail/project.rb', line 26 def new_suite( args ) @api.add_suite( args.merge({:project_id => id}) ) end |
#plans ⇒ Object
Return a list of plans belonging to this project
20 21 22 |
# File 'lib/test_rail/project.rb', line 20 def plans @api.get_plans( :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 |