kalibro_gem 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/features/step_definitions/base_tool_steps.rb +5 -5
- data/features/step_definitions/processing_steps.rb +6 -6
- data/kalibro_gem.gemspec +3 -2
- data/lib/kalibro_gem/version.rb +1 -1
- data/spec/entities/base_tool_spec.rb +13 -13
- data/spec/entities/configuration_spec.rb +5 -5
- data/spec/entities/date_metric_result_spec.rb +5 -5
- data/spec/entities/date_module_result_spec.rb +5 -5
- data/spec/entities/metric_configuration_snapshot_spec.rb +10 -10
- data/spec/entities/metric_configuration_spec.rb +14 -14
- data/spec/entities/metric_result_spec.rb +17 -17
- data/spec/entities/metric_spec.rb +3 -3
- data/spec/entities/model_spec.rb +30 -30
- data/spec/entities/module_result_spec.rb +14 -14
- data/spec/entities/process_time_spec.rb +2 -2
- data/spec/entities/processing_spec.rb +23 -23
- data/spec/entities/project_spec.rb +5 -5
- data/spec/entities/range_snapshot_spec.rb +5 -5
- data/spec/entities/range_spec.rb +20 -20
- data/spec/entities/reading_group_spec.rb +5 -5
- data/spec/entities/reading_spec.rb +11 -11
- data/spec/entities/repository_observer_spec.rb +14 -14
- data/spec/entities/repository_spec.rb +12 -12
- data/spec/entities/stack_trace_element_spec.rb +1 -1
- data/spec/entities/throwable_spec.rb +4 -4
- data/spec/helpers/aggregation_options_spec.rb +1 -1
- data/spec/helpers/hash_converters_spec.rb +10 -10
- data/spec/helpers/xml_converters_spec.rb +5 -5
- data/spec/kalibro_entities_spec.rb +10 -11
- data/spec/spec_helper.rb +62 -6
- metadata +21 -6
@@ -22,12 +22,12 @@ describe KalibroGem::Entities::ProcessTime do
|
|
22
22
|
|
23
23
|
it 'should set the time attribute to 6' do
|
24
24
|
subject.time = 6
|
25
|
-
subject.time.
|
25
|
+
expect(subject.time).to eq 6
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'should convert to integer' do
|
29
29
|
subject.time = "5"
|
30
|
-
subject.time.
|
30
|
+
expect(subject.time).to eq 5
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -22,19 +22,19 @@ describe KalibroGem::Entities::Processing do
|
|
22
22
|
describe 'id=' do
|
23
23
|
it 'should convert the id attribute to integer' do
|
24
24
|
subject.id = "41"
|
25
|
-
subject.id.
|
25
|
+
expect(subject.id).to eq 41
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
describe 'date=' do
|
30
30
|
it 'should set the date attribute' do
|
31
31
|
subject.date = date
|
32
|
-
subject.date.
|
32
|
+
expect(subject.date).to eq date
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'should convert strings to date format' do
|
36
36
|
subject.date = "2013-09-17T18:26:43.151+00:00"
|
37
|
-
subject.date.
|
37
|
+
expect(subject.date).to be_kind_of(DateTime)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -44,20 +44,20 @@ describe KalibroGem::Entities::Processing do
|
|
44
44
|
context 'process_time=' do
|
45
45
|
it 'should set the process_time attribute as a list of objects' do
|
46
46
|
subject.process_time = another_process_time.to_hash
|
47
|
-
subject.process_time.
|
47
|
+
expect(subject.process_time).to eq [another_process_time]
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
context 'process_times=' do
|
52
52
|
it 'should set the process_time attribute' do
|
53
53
|
subject.process_times = [another_process_time]
|
54
|
-
subject.process_time.
|
54
|
+
expect(subject.process_time).to eq [another_process_time]
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
58
|
context 'process_times' do
|
59
59
|
it 'should get the process_time attribute' do
|
60
|
-
subject.process_times.
|
60
|
+
expect(subject.process_times).to eq subject.process_time
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
@@ -67,14 +67,14 @@ describe KalibroGem::Entities::Processing do
|
|
67
67
|
|
68
68
|
it 'should set the attribute error as an object' do
|
69
69
|
subject.error = error.to_hash
|
70
|
-
subject.error.
|
70
|
+
expect(subject.error).to eq error
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
74
|
describe 'results_root_id=' do
|
75
75
|
it 'should set the attribute results root id as an integer' do
|
76
76
|
subject.results_root_id = "36"
|
77
|
-
subject.results_root_id.
|
77
|
+
expect(subject.results_root_id).to eq 36
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -91,7 +91,7 @@ describe KalibroGem::Entities::Processing do
|
|
91
91
|
|
92
92
|
it 'should convert the hash to a Boolean class' do
|
93
93
|
response = KalibroGem::Entities::Processing.has_processing repository.id
|
94
|
-
response.
|
94
|
+
expect(response).to be_a_kind_of(FalseClass)
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -105,7 +105,7 @@ describe KalibroGem::Entities::Processing do
|
|
105
105
|
|
106
106
|
it 'should convert the hash to a Boolean class' do
|
107
107
|
response = KalibroGem::Entities::Processing.has_ready_processing repository.id
|
108
|
-
response.
|
108
|
+
expect(response).to be_a_kind_of(FalseClass)
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
@@ -119,7 +119,7 @@ describe KalibroGem::Entities::Processing do
|
|
119
119
|
|
120
120
|
it 'should convert the hash to a Boolean class' do
|
121
121
|
response = KalibroGem::Entities::Processing.has_processing_after(repository.id, date)
|
122
|
-
response.
|
122
|
+
expect(response).to be_a_kind_of(FalseClass)
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
@@ -133,7 +133,7 @@ describe KalibroGem::Entities::Processing do
|
|
133
133
|
|
134
134
|
it 'should convert the hash to a Boolean class' do
|
135
135
|
response = KalibroGem::Entities::Processing.has_processing_before(repository.id, date)
|
136
|
-
response.
|
136
|
+
expect(response).to be_a_kind_of(FalseClass)
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
@@ -148,7 +148,7 @@ describe KalibroGem::Entities::Processing do
|
|
148
148
|
|
149
149
|
it 'should return the state as string' do
|
150
150
|
response = KalibroGem::Entities::Processing.last_processing_state_of repository.id
|
151
|
-
response.
|
151
|
+
expect(response).to eq(any_state)
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
@@ -171,7 +171,7 @@ describe KalibroGem::Entities::Processing do
|
|
171
171
|
|
172
172
|
it 'should return the last ready processing' do
|
173
173
|
response = KalibroGem::Entities::Processing.processing_of repository.id
|
174
|
-
response.state.
|
174
|
+
expect(response.state).to eq(processing.state)
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
@@ -190,7 +190,7 @@ describe KalibroGem::Entities::Processing do
|
|
190
190
|
|
191
191
|
it 'should return the last processing' do
|
192
192
|
response = KalibroGem::Entities::Processing.processing_of repository.id
|
193
|
-
response.state.
|
193
|
+
expect(response.state).to eq(processing.state)
|
194
194
|
end
|
195
195
|
end
|
196
196
|
end
|
@@ -211,7 +211,7 @@ describe KalibroGem::Entities::Processing do
|
|
211
211
|
|
212
212
|
it 'should return the first processing after the given date' do
|
213
213
|
response = KalibroGem::Entities::Processing.processing_with_date_of(repository.id, date)
|
214
|
-
response.state.
|
214
|
+
expect(response.state).to eq(processing.state)
|
215
215
|
end
|
216
216
|
end
|
217
217
|
|
@@ -235,7 +235,7 @@ describe KalibroGem::Entities::Processing do
|
|
235
235
|
|
236
236
|
it 'should return the last ready processing' do
|
237
237
|
response = KalibroGem::Entities::Processing.processing_with_date_of(repository.id, date)
|
238
|
-
response.state.
|
238
|
+
expect(response.state).to eq(processing.state)
|
239
239
|
end
|
240
240
|
end
|
241
241
|
|
@@ -254,7 +254,7 @@ describe KalibroGem::Entities::Processing do
|
|
254
254
|
|
255
255
|
it 'should return the last ready processing' do
|
256
256
|
response = KalibroGem::Entities::Processing.processing_with_date_of(repository.id, date)
|
257
|
-
response.
|
257
|
+
expect(response).to be_nil
|
258
258
|
end
|
259
259
|
end
|
260
260
|
end
|
@@ -269,7 +269,7 @@ describe KalibroGem::Entities::Processing do
|
|
269
269
|
|
270
270
|
it 'should return a processing object' do
|
271
271
|
response = KalibroGem::Entities::Processing.last_ready_processing_of repository.id
|
272
|
-
response.state.
|
272
|
+
expect(response.state).to eq(processing.state)
|
273
273
|
end
|
274
274
|
end
|
275
275
|
|
@@ -283,7 +283,7 @@ describe KalibroGem::Entities::Processing do
|
|
283
283
|
|
284
284
|
it 'should return a processing object' do
|
285
285
|
response = KalibroGem::Entities::Processing.first_processing_of repository.id
|
286
|
-
response.state.
|
286
|
+
expect(response.state).to eq(processing.state)
|
287
287
|
end
|
288
288
|
end
|
289
289
|
|
@@ -297,7 +297,7 @@ describe KalibroGem::Entities::Processing do
|
|
297
297
|
|
298
298
|
it 'should return a processing object' do
|
299
299
|
response = KalibroGem::Entities::Processing.last_processing_of repository.id
|
300
|
-
response.state.
|
300
|
+
expect(response.state).to eq(processing.state)
|
301
301
|
end
|
302
302
|
end
|
303
303
|
|
@@ -311,7 +311,7 @@ describe KalibroGem::Entities::Processing do
|
|
311
311
|
|
312
312
|
it 'should return a processing object' do
|
313
313
|
response = KalibroGem::Entities::Processing.first_processing_after(repository.id, date)
|
314
|
-
response.state.
|
314
|
+
expect(response.state).to eq(processing.state)
|
315
315
|
end
|
316
316
|
end
|
317
317
|
|
@@ -325,7 +325,7 @@ describe KalibroGem::Entities::Processing do
|
|
325
325
|
|
326
326
|
it 'should return a processing object' do
|
327
327
|
response = KalibroGem::Entities::Processing.last_processing_before(repository.id, date)
|
328
|
-
response.state.
|
328
|
+
expect(response.state).to eq(processing.state)
|
329
329
|
end
|
330
330
|
end
|
331
331
|
end
|
@@ -21,14 +21,14 @@ describe KalibroGem::Entities::Project do
|
|
21
21
|
subject { FactoryGirl.build(:project, {id: 42}) }
|
22
22
|
|
23
23
|
it 'should have the id set to 42' do
|
24
|
-
subject.id.
|
24
|
+
expect(subject.id).to eq(42)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
describe 'id=' do
|
29
29
|
it 'should set the value of the attribute id as integer' do
|
30
30
|
subject.id = "42"
|
31
|
-
subject.id.
|
31
|
+
expect(subject.id).to eq(42)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -42,7 +42,7 @@ describe KalibroGem::Entities::Project do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'should return nil' do
|
45
|
-
KalibroGem::Entities::Project.all.
|
45
|
+
expect(KalibroGem::Entities::Project.all).to be_empty
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -60,8 +60,8 @@ describe KalibroGem::Entities::Project do
|
|
60
60
|
it 'should return a list with projects' do
|
61
61
|
projects = KalibroGem::Entities::Project.all
|
62
62
|
|
63
|
-
projects.first.name.
|
64
|
-
projects.last.name.
|
63
|
+
expect(projects.first.name).to eq(project.name)
|
64
|
+
expect(projects.last.name).to eq(another_project.name)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
@@ -20,31 +20,31 @@ describe KalibroGem::Entities::RangeSnapshot do
|
|
20
20
|
describe 'beginning=' do
|
21
21
|
it 'should set the value of the attribute beginning' do
|
22
22
|
subject.beginning = 3
|
23
|
-
subject.beginning.
|
23
|
+
expect(subject.beginning).to eq(3)
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'should value -1.0/0 when value be set to -INF' do
|
27
27
|
subject.beginning = "-INF"
|
28
|
-
subject.beginning.
|
28
|
+
expect(subject.beginning).to eq(-1.0/0)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
describe 'end=' do
|
33
33
|
it 'should set the value of the attribute end' do
|
34
34
|
subject.end = 6
|
35
|
-
subject.end.
|
35
|
+
expect(subject.end).to eq(6)
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'should value 1.0/0 when value be set to INF' do
|
39
39
|
subject.end = "INF"
|
40
|
-
subject.end.
|
40
|
+
expect(subject.end).to eq(1.0/0)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
describe 'grade=' do
|
45
45
|
it 'should set the value of the attribute grade' do
|
46
46
|
subject.grade = 18
|
47
|
-
subject.grade.
|
47
|
+
expect(subject.grade).to eq(18)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
data/spec/entities/range_spec.rb
CHANGED
@@ -22,38 +22,38 @@ describe KalibroGem::Entities::Range do
|
|
22
22
|
describe 'id=' do
|
23
23
|
it 'should set the value of the attribute id as an integer' do
|
24
24
|
subject.id = "4"
|
25
|
-
subject.id.
|
25
|
+
expect(subject.id).to eq(4)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
describe 'reading_id=' do
|
30
30
|
it 'should set the value of the attribute reading_id as an integer' do
|
31
31
|
subject.reading_id = "12"
|
32
|
-
subject.reading_id.
|
32
|
+
expect(subject.reading_id).to eq(12)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
describe 'beginning=' do
|
37
37
|
it 'should set the value of the attribute as a float' do
|
38
38
|
subject.beginning = "12.3"
|
39
|
-
subject.beginning.
|
39
|
+
expect(subject.beginning).to eq(12.3)
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'should set beginning to infinity' do
|
43
43
|
subject.beginning = "-INF"
|
44
|
-
subject.beginning.
|
44
|
+
expect(subject.beginning).to eq("-INF")
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
describe 'end=' do
|
49
49
|
it 'should set the value of the attribute as a float' do
|
50
50
|
subject.end = "23.4"
|
51
|
-
subject.end.
|
51
|
+
expect(subject.end).to eq(23.4)
|
52
52
|
end
|
53
53
|
|
54
54
|
it 'should set end to infinity' do
|
55
55
|
subject.end = "INF"
|
56
|
-
subject.end.
|
56
|
+
expect(subject.end).to eq("INF")
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
@@ -69,19 +69,19 @@ describe KalibroGem::Entities::Range do
|
|
69
69
|
|
70
70
|
context 'label' do
|
71
71
|
it 'should get the label of the reading' do
|
72
|
-
subject.label.
|
72
|
+
expect(subject.label).to eq(reading.label)
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
76
|
context 'grade' do
|
77
77
|
it 'should get the grade of the reading' do
|
78
|
-
subject.grade.
|
78
|
+
expect(subject.grade).to eq(reading.grade)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
82
|
context 'color' do
|
83
83
|
it 'should get the color of the reading' do
|
84
|
-
subject.color.
|
84
|
+
expect(subject.color).to eq(reading.color)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
@@ -98,7 +98,7 @@ describe KalibroGem::Entities::Range do
|
|
98
98
|
end
|
99
99
|
|
100
100
|
it 'should return a list with the ranges' do
|
101
|
-
KalibroGem::Entities::Range.ranges_of(metric_configuration.id).
|
101
|
+
expect(KalibroGem::Entities::Range.ranges_of(metric_configuration.id)).to eq([])
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
@@ -111,8 +111,8 @@ describe KalibroGem::Entities::Range do
|
|
111
111
|
end
|
112
112
|
|
113
113
|
it 'should return a list with the range' do
|
114
|
-
KalibroGem::Entities::Range.ranges_of(metric_configuration.id).
|
115
|
-
first.beginning.
|
114
|
+
expect(KalibroGem::Entities::Range.ranges_of(metric_configuration.id).
|
115
|
+
first.beginning).to eq(subject.beginning)
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
@@ -128,8 +128,8 @@ describe KalibroGem::Entities::Range do
|
|
128
128
|
|
129
129
|
it 'should return a list with the ranges' do
|
130
130
|
ranges = KalibroGem::Entities::Range.ranges_of(metric_configuration.id)
|
131
|
-
ranges.first.comments.
|
132
|
-
ranges.last.comments.
|
131
|
+
expect(ranges.first.comments).to eq(subject.comments)
|
132
|
+
expect(ranges.last.comments).to eq(another_range.comments)
|
133
133
|
end
|
134
134
|
end
|
135
135
|
end
|
@@ -146,8 +146,8 @@ describe KalibroGem::Entities::Range do
|
|
146
146
|
end
|
147
147
|
|
148
148
|
it 'should make a request to save model with id and return true without errors' do
|
149
|
-
subject.save.
|
150
|
-
subject.kalibro_errors.
|
149
|
+
expect(subject.save).to be(true)
|
150
|
+
expect(subject.kalibro_errors).to be_empty
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
@@ -158,7 +158,7 @@ describe KalibroGem::Entities::Range do
|
|
158
158
|
end
|
159
159
|
|
160
160
|
it 'should return true' do
|
161
|
-
KalibroGem::Entities::Range.exists?(subject.id).
|
161
|
+
expect(KalibroGem::Entities::Range.exists?(subject.id)).to be_truthy
|
162
162
|
end
|
163
163
|
end
|
164
164
|
|
@@ -168,7 +168,7 @@ describe KalibroGem::Entities::Range do
|
|
168
168
|
end
|
169
169
|
|
170
170
|
it 'should return false' do
|
171
|
-
KalibroGem::Entities::Range.exists?(subject.id).
|
171
|
+
expect(KalibroGem::Entities::Range.exists?(subject.id)).to be_falsey
|
172
172
|
end
|
173
173
|
end
|
174
174
|
end
|
@@ -182,7 +182,7 @@ describe KalibroGem::Entities::Range do
|
|
182
182
|
end
|
183
183
|
|
184
184
|
it 'should return the range' do
|
185
|
-
KalibroGem::Entities::Range.find(subject.id).
|
185
|
+
expect(KalibroGem::Entities::Range.find(subject.id)).to eq(subject)
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
@@ -219,7 +219,7 @@ describe KalibroGem::Entities::Range do
|
|
219
219
|
end
|
220
220
|
|
221
221
|
it 'should list all the ranges' do
|
222
|
-
KalibroGem::Entities::Range.all.
|
222
|
+
expect(KalibroGem::Entities::Range.all).to include(subject)
|
223
223
|
end
|
224
224
|
end
|
225
225
|
end
|
@@ -22,7 +22,7 @@ describe KalibroGem::Entities::ReadingGroup do
|
|
22
22
|
|
23
23
|
it 'should set the id attribute values as an integer' do
|
24
24
|
subject.id = "222"
|
25
|
-
subject.id.
|
25
|
+
expect(subject.id).to eq(222)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -36,7 +36,7 @@ describe KalibroGem::Entities::ReadingGroup do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'should return nil' do
|
39
|
-
KalibroGem::Entities::ReadingGroup.all.
|
39
|
+
expect(KalibroGem::Entities::ReadingGroup.all).to be_empty
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -52,8 +52,8 @@ describe KalibroGem::Entities::ReadingGroup do
|
|
52
52
|
it 'should return nil' do
|
53
53
|
reading_groups = KalibroGem::Entities::ReadingGroup.all
|
54
54
|
|
55
|
-
reading_groups.first.name.
|
56
|
-
reading_groups.last.name.
|
55
|
+
expect(reading_groups.first.name).to eq(reading_group.name)
|
56
|
+
expect(reading_groups.last.name).to eq(reading_group.name)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -70,7 +70,7 @@ describe KalibroGem::Entities::ReadingGroup do
|
|
70
70
|
|
71
71
|
it 'should remain with the errors array empty' do
|
72
72
|
subject.destroy
|
73
|
-
subject.kalibro_errors.
|
73
|
+
expect(subject.kalibro_errors).to be_empty
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|