Class: Crab::TestCase
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
Methods included from Utilities
#add_or_update_options, #credentials_file, #current_project_name, #sanitize, #sanitize_options, #state_after, #state_before, #state_from, #valid_credentials_file, #valid_project_name
Methods included from Logging
#logger
Constructor Details
#initialize(rally_test_case, dry_run) ⇒ TestCase
Returns a new instance of TestCase.
12
13
14
15
|
# File 'lib/crab/testcase.rb', line 12
def initialize(rally_test_case, dry_run)
@rally_test_case = rally_test_case
@dry_run
end
|
Instance Method Details
#delete ⇒ Object
64
65
66
67
68
69
70
|
# File 'lib/crab/testcase.rb', line 64
def delete
if @dry_run
puts "Would delete test case #{formatted_id}"
else
@rally_test_case.delete
end
end
|
#description ⇒ Object
25
26
27
28
29
30
31
|
# File 'lib/crab/testcase.rb', line 25
def description
sanitize(@rally_test_case.description || '').gsub(/ +/, "\n").gsub(/\n\n/, "\n").gsub(/\n/, "\n ")
end
|
17
18
19
|
# File 'lib/crab/testcase.rb', line 17
def formatted_id
@rally_test_case.formatted_i_d
end
|
#name ⇒ Object
21
22
23
|
# File 'lib/crab/testcase.rb', line 21
def name
@rally_test_case.name
end
|
#priority ⇒ Object
44
45
46
|
# File 'lib/crab/testcase.rb', line 44
def priority
@rally_test_case.priority
end
|
#revision ⇒ Object
39
40
41
42
|
# File 'lib/crab/testcase.rb', line 39
def revision
rev = @rally_test_case.revision_history.revisions.first
"#{rev.revision_number}, by #{rev.user}"
end
|
#risk ⇒ Object
48
49
50
|
# File 'lib/crab/testcase.rb', line 48
def risk
@rally_test_case.risk
end
|
#steps ⇒ Object
80
81
82
|
# File 'lib/crab/testcase.rb', line 80
def steps
Array(@rally_test_case.steps).map {|step| step.input }
end
|
#story ⇒ Object
60
61
62
|
# File 'lib/crab/testcase.rb', line 60
def story
Crab::Story.new(@rally_test_case.work_product, @dry_run)
end
|
33
34
35
36
37
|
# File 'lib/crab/testcase.rb', line 33
def tags
[priority, risk, test_method, test_type].map(&:parameterize).reject do |tag|
%w{important medium manual acceptance}.include? tag
end
end
|
#test_method ⇒ Object
52
53
54
|
# File 'lib/crab/testcase.rb', line 52
def test_method
@rally_test_case.elements[:method]
end
|
#test_type ⇒ Object
56
57
58
|
# File 'lib/crab/testcase.rb', line 56
def test_type
@rally_test_case.elements[:type]
end
|
#update(options) ⇒ Object
72
73
74
75
76
77
78
|
# File 'lib/crab/testcase.rb', line 72
def update(options)
if @dry_run
puts "Would update test case #{formatted_id} with #{options.inspect}"
else
@rally_test_case.update options
end
end
|