kalibro_gatekeeper_client 0.1.0 → 0.1.1
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/.ruby-version +1 -1
- data/.travis.yml +8 -6
- data/features/step_definitions/base_tool_steps.rb +5 -5
- data/features/step_definitions/configuration_steps.rb +5 -5
- data/features/step_definitions/metric_configuration_steps.rb +5 -3
- data/features/step_definitions/metric_result_steps.rb +6 -6
- data/features/step_definitions/module_result_steps.rb +5 -5
- data/features/step_definitions/processing_steps.rb +6 -6
- data/features/step_definitions/project_steps.rb +4 -4
- data/features/step_definitions/range_steps.rb +11 -11
- data/features/step_definitions/reading_group_steps.rb +2 -2
- data/features/step_definitions/reading_steps.rb +6 -3
- data/features/step_definitions/repository_steps.rb +7 -7
- data/kalibro_gatekeeper_client.gemspec +2 -2
- data/lib/kalibro_gatekeeper_client/entities/metric.rb +5 -1
- data/lib/kalibro_gatekeeper_client/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 +16 -16
- data/spec/entities/metric_spec.rb +22 -4
- data/spec/entities/model_spec.rb +33 -33
- 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 +21 -21
- 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 +9 -9
- data/spec/spec_helper.rb +61 -6
- metadata +7 -6
@@ -29,8 +29,8 @@ describe KalibroGatekeeperClient::Entities::ModuleResult do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'should return a hash with module result' do
|
32
|
-
KalibroGatekeeperClient::Entities::ModuleResult.
|
33
|
-
find(subject.id).id.
|
32
|
+
expect(KalibroGatekeeperClient::Entities::ModuleResult.
|
33
|
+
find(subject.id).id).to eq(subject.id)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -61,7 +61,7 @@ describe KalibroGatekeeperClient::Entities::ModuleResult do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
it 'should return a list of a objects' do
|
64
|
-
subject.children.
|
64
|
+
expect(subject.children).to eq [subject]
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -77,13 +77,13 @@ describe KalibroGatekeeperClient::Entities::ModuleResult do
|
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'should return its parent' do
|
80
|
-
subject.parents.
|
80
|
+
expect(subject.parents).to eq [root_module_result]
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
84
|
context 'when module result does not have a parent' do
|
85
85
|
it 'should return an empty list' do
|
86
|
-
root_module_result.parents.
|
86
|
+
expect(root_module_result.parents).to eq []
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
@@ -91,7 +91,7 @@ describe KalibroGatekeeperClient::Entities::ModuleResult do
|
|
91
91
|
describe 'id=' do
|
92
92
|
it 'should set the id attribute as integer' do
|
93
93
|
subject.id = "23"
|
94
|
-
subject.id.
|
94
|
+
expect(subject.id).to eq 23
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -100,21 +100,21 @@ describe KalibroGatekeeperClient::Entities::ModuleResult do
|
|
100
100
|
|
101
101
|
it 'should set the module attribute as a Module object' do
|
102
102
|
subject.module = another_module.to_hash
|
103
|
-
subject.module.
|
103
|
+
expect(subject.module).to eq another_module
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
107
|
describe 'grade=' do
|
108
108
|
it 'should set the grade attribute as float' do
|
109
109
|
subject.grade = "12.5"
|
110
|
-
subject.grade.
|
110
|
+
expect(subject.grade).to eq 12.5
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
114
|
describe 'parent_id=' do
|
115
115
|
it 'should set the parent_id attribute as integer' do
|
116
116
|
subject.parent_id = "73"
|
117
|
-
subject.parent_id.
|
117
|
+
expect(subject.parent_id).to eq 73
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
@@ -129,7 +129,7 @@ describe KalibroGatekeeperClient::Entities::ModuleResult do
|
|
129
129
|
|
130
130
|
it 'should return a list of date_module_results' do
|
131
131
|
date_module_results = KalibroGatekeeperClient::Entities::ModuleResult.history_of subject.id
|
132
|
-
date_module_results.first.result.
|
132
|
+
expect(date_module_results.first.result).to eq date_module_result.result
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
@@ -142,8 +142,8 @@ describe KalibroGatekeeperClient::Entities::ModuleResult do
|
|
142
142
|
end
|
143
143
|
|
144
144
|
it 'should return true for folder? and false for file?' do
|
145
|
-
subject.folder
|
146
|
-
subject.file
|
145
|
+
expect(subject.folder?).to be_truthy
|
146
|
+
expect(subject.file?).to be_falsey
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
@@ -155,8 +155,8 @@ describe KalibroGatekeeperClient::Entities::ModuleResult do
|
|
155
155
|
end
|
156
156
|
|
157
157
|
it 'should return true for folder? and false for file?' do
|
158
|
-
subject.folder
|
159
|
-
subject.file
|
158
|
+
expect(subject.folder?).to be_falsey
|
159
|
+
expect(subject.file?).to be_truthy
|
160
160
|
end
|
161
161
|
end
|
162
162
|
end
|
@@ -22,12 +22,12 @@ describe KalibroGatekeeperClient::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 KalibroGatekeeperClient::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 KalibroGatekeeperClient::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 KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
91
91
|
|
92
92
|
it 'should convert the hash to a Boolean class' do
|
93
93
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
105
105
|
|
106
106
|
it 'should convert the hash to a Boolean class' do
|
107
107
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
119
119
|
|
120
120
|
it 'should convert the hash to a Boolean class' do
|
121
121
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
133
133
|
|
134
134
|
it 'should convert the hash to a Boolean class' do
|
135
135
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
148
148
|
|
149
149
|
it 'should return the state as string' do
|
150
150
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
171
171
|
|
172
172
|
it 'should return the last ready processing' do
|
173
173
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
190
190
|
|
191
191
|
it 'should return the last processing' do
|
192
192
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
211
211
|
|
212
212
|
it 'should return the first processing after the given date' do
|
213
213
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
235
235
|
|
236
236
|
it 'should return the last ready processing' do
|
237
237
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
254
254
|
|
255
255
|
it 'should return the last ready processing' do
|
256
256
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
269
269
|
|
270
270
|
it 'should return a processing object' do
|
271
271
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
283
283
|
|
284
284
|
it 'should return a processing object' do
|
285
285
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
297
297
|
|
298
298
|
it 'should return a processing object' do
|
299
299
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
311
311
|
|
312
312
|
it 'should return a processing object' do
|
313
313
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Processing do
|
|
325
325
|
|
326
326
|
it 'should return a processing object' do
|
327
327
|
response = KalibroGatekeeperClient::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 KalibroGatekeeperClient::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 KalibroGatekeeperClient::Entities::Project do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'should return nil' do
|
45
|
-
KalibroGatekeeperClient::Entities::Project.all.
|
45
|
+
expect(KalibroGatekeeperClient::Entities::Project.all).to be_empty
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -60,8 +60,8 @@ describe KalibroGatekeeperClient::Entities::Project do
|
|
60
60
|
it 'should return a list with projects' do
|
61
61
|
projects = KalibroGatekeeperClient::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 KalibroGatekeeperClient::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 KalibroGatekeeperClient::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,25 +69,25 @@ describe KalibroGatekeeperClient::Entities::Range do
|
|
69
69
|
|
70
70
|
context 'reading' do
|
71
71
|
it 'should return the correct reading' do
|
72
|
-
subject.reading.
|
72
|
+
expect(subject.reading).to eq(reading)
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
76
|
context 'label' do
|
77
77
|
it 'should get the label of the reading' do
|
78
|
-
subject.label.
|
78
|
+
expect(subject.label).to eq(reading.label)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
82
|
context 'grade' do
|
83
83
|
it 'should get the grade of the reading' do
|
84
|
-
subject.grade.
|
84
|
+
expect(subject.grade).to eq(reading.grade)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
88
|
context 'color' do
|
89
89
|
it 'should get the color of the reading' do
|
90
|
-
subject.color.
|
90
|
+
expect(subject.color).to eq(reading.color)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -104,7 +104,7 @@ describe KalibroGatekeeperClient::Entities::Range do
|
|
104
104
|
end
|
105
105
|
|
106
106
|
it 'should return a list with the ranges' do
|
107
|
-
KalibroGatekeeperClient::Entities::Range.ranges_of(metric_configuration.id).
|
107
|
+
expect(KalibroGatekeeperClient::Entities::Range.ranges_of(metric_configuration.id)).to eq([])
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
@@ -117,8 +117,8 @@ describe KalibroGatekeeperClient::Entities::Range do
|
|
117
117
|
end
|
118
118
|
|
119
119
|
it 'should return a list with the range' do
|
120
|
-
KalibroGatekeeperClient::Entities::Range.ranges_of(metric_configuration.id).
|
121
|
-
first.beginning.
|
120
|
+
expect(KalibroGatekeeperClient::Entities::Range.ranges_of(metric_configuration.id).
|
121
|
+
first.beginning).to eq(subject.beginning)
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
@@ -134,8 +134,8 @@ describe KalibroGatekeeperClient::Entities::Range do
|
|
134
134
|
|
135
135
|
it 'should return a list with the ranges' do
|
136
136
|
ranges = KalibroGatekeeperClient::Entities::Range.ranges_of(metric_configuration.id)
|
137
|
-
ranges.first.comments.
|
138
|
-
ranges.last.comments.
|
137
|
+
expect(ranges.first.comments).to eq(subject.comments)
|
138
|
+
expect(ranges.last.comments).to eq(another_range.comments)
|
139
139
|
end
|
140
140
|
end
|
141
141
|
end
|
@@ -152,8 +152,8 @@ describe KalibroGatekeeperClient::Entities::Range do
|
|
152
152
|
end
|
153
153
|
|
154
154
|
it 'should make a request to save model with id and return true without errors' do
|
155
|
-
subject.save.
|
156
|
-
subject.kalibro_errors.
|
155
|
+
expect(subject.save).to be(true)
|
156
|
+
expect(subject.kalibro_errors).to be_empty
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
@@ -164,7 +164,7 @@ describe KalibroGatekeeperClient::Entities::Range do
|
|
164
164
|
end
|
165
165
|
|
166
166
|
it 'should return true' do
|
167
|
-
KalibroGatekeeperClient::Entities::Range.exists?(subject.id).
|
167
|
+
expect(KalibroGatekeeperClient::Entities::Range.exists?(subject.id)).to be_truthy
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
@@ -174,7 +174,7 @@ describe KalibroGatekeeperClient::Entities::Range do
|
|
174
174
|
end
|
175
175
|
|
176
176
|
it 'should return false' do
|
177
|
-
KalibroGatekeeperClient::Entities::Range.exists?(subject.id).
|
177
|
+
expect(KalibroGatekeeperClient::Entities::Range.exists?(subject.id)).to be_falsey
|
178
178
|
end
|
179
179
|
end
|
180
180
|
end
|
@@ -188,7 +188,7 @@ describe KalibroGatekeeperClient::Entities::Range do
|
|
188
188
|
end
|
189
189
|
|
190
190
|
it 'should return the range' do
|
191
|
-
KalibroGatekeeperClient::Entities::Range.find(subject.id).
|
191
|
+
expect(KalibroGatekeeperClient::Entities::Range.find(subject.id)).to eq(subject)
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
@@ -225,7 +225,7 @@ describe KalibroGatekeeperClient::Entities::Range do
|
|
225
225
|
end
|
226
226
|
|
227
227
|
it 'should list all the ranges' do
|
228
|
-
KalibroGatekeeperClient::Entities::Range.all.
|
228
|
+
expect(KalibroGatekeeperClient::Entities::Range.all).to include(subject)
|
229
229
|
end
|
230
230
|
end
|
231
231
|
end
|