Class: Crab::TestCase
- Inherits:
-
Object
- Object
- Crab::TestCase
- Defined in:
- lib/crab/testcase.rb
Constant Summary collapse
- PRIORITIES =
%w{useful important critical}
- RISKS =
%w{low medium high}
- METHODS =
%w{automated manual}
- TYPES =
%w{acceptance functional non-functional performance regression usability}
Instance Method Summary collapse
- #delete ⇒ Object
- #formatted_id ⇒ Object
-
#initialize(rally_test_case, dry_run) ⇒ TestCase
constructor
A new instance of TestCase.
- #name ⇒ Object
- #priority ⇒ Object
- #risk ⇒ Object
- #steps ⇒ Object
- #story ⇒ Object
- #tags ⇒ Object
- #test_method ⇒ Object
- #test_type ⇒ Object
- #update(options) ⇒ Object
Constructor Details
#initialize(rally_test_case, dry_run) ⇒ TestCase
Returns a new instance of TestCase.
10 11 12 13 |
# File 'lib/crab/testcase.rb', line 10 def initialize(rally_test_case, dry_run) @rally_test_case = rally_test_case @dry_run end |
Instance Method Details
#delete ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/crab/testcase.rb', line 47 def delete if @dry_run puts "Would delete test case #{formatted_id}" else @rally_test_case.delete end end |
#formatted_id ⇒ Object
15 16 17 |
# File 'lib/crab/testcase.rb', line 15 def formatted_id @rally_test_case.formatted_i_d end |
#name ⇒ Object
19 20 21 |
# File 'lib/crab/testcase.rb', line 19 def name @rally_test_case.name end |
#priority ⇒ Object
27 28 29 |
# File 'lib/crab/testcase.rb', line 27 def priority @rally_test_case.priority end |
#risk ⇒ Object
31 32 33 |
# File 'lib/crab/testcase.rb', line 31 def risk @rally_test_case.risk end |
#steps ⇒ Object
63 64 65 |
# File 'lib/crab/testcase.rb', line 63 def steps Array(@rally_test_case.steps).map {|step| step.input } end |
#story ⇒ Object
43 44 45 |
# File 'lib/crab/testcase.rb', line 43 def story Crab::Story.new(@rally_test_case.work_product, @dry_run) end |
#tags ⇒ Object
23 24 25 |
# File 'lib/crab/testcase.rb', line 23 def [priority, risk, test_method, test_type].map &:parameterize end |
#test_method ⇒ Object
35 36 37 |
# File 'lib/crab/testcase.rb', line 35 def test_method @rally_test_case.elements[:method] end |
#test_type ⇒ Object
39 40 41 |
# File 'lib/crab/testcase.rb', line 39 def test_type @rally_test_case.elements[:type] end |
#update(options) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/crab/testcase.rb', line 55 def update() if @dry_run puts "Would update test case #{formatted_id} with #{.inspect}" else @rally_test_case.update end end |