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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +2 -0
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +8 -6
  5. data/features/step_definitions/base_tool_steps.rb +5 -5
  6. data/features/step_definitions/configuration_steps.rb +5 -5
  7. data/features/step_definitions/metric_configuration_steps.rb +5 -3
  8. data/features/step_definitions/metric_result_steps.rb +6 -6
  9. data/features/step_definitions/module_result_steps.rb +5 -5
  10. data/features/step_definitions/processing_steps.rb +6 -6
  11. data/features/step_definitions/project_steps.rb +4 -4
  12. data/features/step_definitions/range_steps.rb +11 -11
  13. data/features/step_definitions/reading_group_steps.rb +2 -2
  14. data/features/step_definitions/reading_steps.rb +6 -3
  15. data/features/step_definitions/repository_steps.rb +7 -7
  16. data/kalibro_gatekeeper_client.gemspec +2 -2
  17. data/lib/kalibro_gatekeeper_client/entities/metric.rb +5 -1
  18. data/lib/kalibro_gatekeeper_client/version.rb +1 -1
  19. data/spec/entities/base_tool_spec.rb +13 -13
  20. data/spec/entities/configuration_spec.rb +5 -5
  21. data/spec/entities/date_metric_result_spec.rb +5 -5
  22. data/spec/entities/date_module_result_spec.rb +5 -5
  23. data/spec/entities/metric_configuration_snapshot_spec.rb +10 -10
  24. data/spec/entities/metric_configuration_spec.rb +14 -14
  25. data/spec/entities/metric_result_spec.rb +16 -16
  26. data/spec/entities/metric_spec.rb +22 -4
  27. data/spec/entities/model_spec.rb +33 -33
  28. data/spec/entities/module_result_spec.rb +14 -14
  29. data/spec/entities/process_time_spec.rb +2 -2
  30. data/spec/entities/processing_spec.rb +23 -23
  31. data/spec/entities/project_spec.rb +5 -5
  32. data/spec/entities/range_snapshot_spec.rb +5 -5
  33. data/spec/entities/range_spec.rb +21 -21
  34. data/spec/entities/reading_group_spec.rb +5 -5
  35. data/spec/entities/reading_spec.rb +11 -11
  36. data/spec/entities/repository_observer_spec.rb +14 -14
  37. data/spec/entities/repository_spec.rb +12 -12
  38. data/spec/entities/stack_trace_element_spec.rb +1 -1
  39. data/spec/entities/throwable_spec.rb +4 -4
  40. data/spec/helpers/aggregation_options_spec.rb +1 -1
  41. data/spec/helpers/hash_converters_spec.rb +10 -10
  42. data/spec/helpers/xml_converters_spec.rb +5 -5
  43. data/spec/kalibro_entities_spec.rb +9 -9
  44. data/spec/spec_helper.rb +61 -6
  45. metadata +7 -6
@@ -22,7 +22,7 @@ describe KalibroGatekeeperClient::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.should eq(222)
25
+ expect(subject.id).to eq(222)
26
26
  end
27
27
  end
28
28
 
@@ -36,7 +36,7 @@ describe KalibroGatekeeperClient::Entities::ReadingGroup do
36
36
  end
37
37
 
38
38
  it 'should return nil' do
39
- KalibroGatekeeperClient::Entities::ReadingGroup.all.should be_empty
39
+ expect(KalibroGatekeeperClient::Entities::ReadingGroup.all).to be_empty
40
40
  end
41
41
  end
42
42
 
@@ -52,8 +52,8 @@ describe KalibroGatekeeperClient::Entities::ReadingGroup do
52
52
  it 'should return nil' do
53
53
  reading_groups = KalibroGatekeeperClient::Entities::ReadingGroup.all
54
54
 
55
- reading_groups.first.name.should eq(reading_group.name)
56
- reading_groups.last.name.should eq(reading_group.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 KalibroGatekeeperClient::Entities::ReadingGroup do
70
70
 
71
71
  it 'should remain with the errors array empty' do
72
72
  subject.destroy
73
- subject.kalibro_errors.should be_empty
73
+ expect(subject.kalibro_errors).to be_empty
74
74
  end
75
75
  end
76
76
  end
@@ -20,14 +20,14 @@ describe KalibroGatekeeperClient::Entities::Reading do
20
20
  describe "id=" do
21
21
  it 'should set the id attribute as an integer' do
22
22
  subject.id = "44"
23
- subject.id.should eq(44)
23
+ expect(subject.id).to eq(44)
24
24
  end
25
25
  end
26
26
 
27
27
  describe "grade=" do
28
28
  it 'should set the grade attribute as a float' do
29
29
  subject.grade = "44.7"
30
- subject.grade.should eq(44.7)
30
+ expect(subject.grade).to eq(44.7)
31
31
  end
32
32
  end
33
33
 
@@ -45,7 +45,7 @@ describe KalibroGatekeeperClient::Entities::Reading do
45
45
 
46
46
  it 'should return a reading object' do
47
47
  response = KalibroGatekeeperClient::Entities::Reading.find(reading.id)
48
- response.label.should eq(reading.label)
48
+ expect(response.label).to eq(reading.label)
49
49
  end
50
50
  end
51
51
 
@@ -79,8 +79,8 @@ describe KalibroGatekeeperClient::Entities::Reading do
79
79
 
80
80
  it 'should returns a list of readings that belongs to the given reading group' do
81
81
  response = KalibroGatekeeperClient::Entities::Reading.readings_of reading_group.id
82
- response.first.label.should eq(reading.label)
83
- response.last.label.should eq(reading.label)
82
+ expect(response.first.label).to eq(reading.label)
83
+ expect(response.last.label).to eq(reading.label)
84
84
  end
85
85
  end
86
86
 
@@ -98,7 +98,7 @@ describe KalibroGatekeeperClient::Entities::Reading do
98
98
  end
99
99
 
100
100
  it 'should list all the readings' do
101
- KalibroGatekeeperClient::Entities::Reading.all.should include(subject)
101
+ expect(KalibroGatekeeperClient::Entities::Reading.all).to include(subject)
102
102
  end
103
103
  end
104
104
  end
@@ -116,9 +116,9 @@ describe KalibroGatekeeperClient::Entities::Reading do
116
116
  end
117
117
 
118
118
  it 'should make a request to save model with id and return true without errors' do
119
- reading.save.should be(true)
120
- reading.id.should eq(reading_id)
121
- reading.kalibro_errors.should be_empty
119
+ expect(reading.save).to be(true)
120
+ expect(reading.id).to eq(reading_id)
121
+ expect(reading.kalibro_errors).to be_empty
122
122
  end
123
123
  end
124
124
 
@@ -131,7 +131,7 @@ describe KalibroGatekeeperClient::Entities::Reading do
131
131
  end
132
132
 
133
133
  it 'should return true' do
134
- KalibroGatekeeperClient::Entities::Reading.exists?(subject.id).should be_true
134
+ expect(KalibroGatekeeperClient::Entities::Reading.exists?(subject.id)).to be_truthy
135
135
  end
136
136
  end
137
137
 
@@ -141,7 +141,7 @@ describe KalibroGatekeeperClient::Entities::Reading do
141
141
  end
142
142
 
143
143
  it 'should return false' do
144
- KalibroGatekeeperClient::Entities::Reading.exists?(subject.id).should be_false
144
+ expect(KalibroGatekeeperClient::Entities::Reading.exists?(subject.id)).to be_falsey
145
145
  end
146
146
  end
147
147
  end
@@ -20,7 +20,7 @@ describe KalibroGatekeeperClient::Entities::RepositoryObserver do
20
20
  describe 'id=' do
21
21
  it 'should set the value of the attribute id' do
22
22
  subject.id = 42
23
- subject.id.should eq(42)
23
+ expect(subject.id).to eq(42)
24
24
  end
25
25
  end
26
26
 
@@ -34,7 +34,7 @@ describe KalibroGatekeeperClient::Entities::RepositoryObserver do
34
34
  end
35
35
 
36
36
  it 'should return nil' do
37
- KalibroGatekeeperClient::Entities::RepositoryObserver.all.should be_empty
37
+ expect(KalibroGatekeeperClient::Entities::RepositoryObserver.all).to be_empty
38
38
  end
39
39
  end
40
40
 
@@ -49,9 +49,9 @@ describe KalibroGatekeeperClient::Entities::RepositoryObserver do
49
49
 
50
50
  it 'should return the two elements' do
51
51
  repository_observers = KalibroGatekeeperClient::Entities::RepositoryObserver.all
52
- repository_observers.size.should eq(2)
53
- repository_observers.first.name.should eq(repository_observer.to_hash[:name])
54
- repository_observers.last.name.should eq(repository_observer.to_hash[:name])
52
+ expect(repository_observers.size).to eq(2)
53
+ expect(repository_observers.first.name).to eq(repository_observer.to_hash[:name])
54
+ expect(repository_observers.last.name).to eq(repository_observer.to_hash[:name])
55
55
  end
56
56
  end
57
57
  end
@@ -67,8 +67,8 @@ describe KalibroGatekeeperClient::Entities::RepositoryObserver do
67
67
  end
68
68
 
69
69
  it 'should get an empty array' do
70
- KalibroGatekeeperClient::Entities::RepositoryObserver.
71
- repository_observers_of(repository_without_observers[:id]).should eq []
70
+ expect(KalibroGatekeeperClient::Entities::RepositoryObserver.
71
+ repository_observers_of(repository_without_observers[:id])).to eq []
72
72
  end
73
73
  end
74
74
 
@@ -86,9 +86,9 @@ describe KalibroGatekeeperClient::Entities::RepositoryObserver do
86
86
  repository_observers = KalibroGatekeeperClient::Entities::RepositoryObserver.
87
87
  repository_observers_of(repository.id)
88
88
 
89
- repository_observers.size.should eq(2)
90
- repository_observers.first.name.should eq(repository_observer.name)
91
- repository_observers.last.name.should eq(repository_observer.name)
89
+ expect(repository_observers.size).to eq(2)
90
+ expect(repository_observers.first.name).to eq(repository_observer.name)
91
+ expect(repository_observers.last.name).to eq(repository_observer.name)
92
92
  end
93
93
  end
94
94
  end
@@ -96,28 +96,28 @@ describe KalibroGatekeeperClient::Entities::RepositoryObserver do
96
96
  describe 'id=' do
97
97
  it 'should set the value of the attribute id' do
98
98
  subject.id = 65
99
- subject.id.should eq(65)
99
+ expect(subject.id).to eq(65)
100
100
  end
101
101
  end
102
102
 
103
103
  describe 'repository_id=' do
104
104
  it 'should set the value of the attribute repository_id' do
105
105
  subject.repository_id = 91
106
- subject.repository_id.should eq(91)
106
+ expect(subject.repository_id).to eq(91)
107
107
  end
108
108
  end
109
109
 
110
110
  describe 'name=' do
111
111
  it 'should set the value of the attribute name' do
112
112
  subject.name = 'William'
113
- subject.name.should eq('William')
113
+ expect(subject.name).to eq('William')
114
114
  end
115
115
  end
116
116
 
117
117
  describe 'email=' do
118
118
  it 'should set the value of the attribute email' do
119
119
  subject.email = 'william@email.com'
120
- subject.email.should eq('william@email.com')
120
+ expect(subject.email).to eq('william@email.com')
121
121
  end
122
122
  end
123
123
  end
@@ -29,7 +29,7 @@ describe KalibroGatekeeperClient::Entities::Repository do
29
29
  end
30
30
 
31
31
  it 'should return an array of repository types' do
32
- KalibroGatekeeperClient::Entities::Repository.repository_types.should eq(["BAZAAR", "GIT", "MERCURIAL", "REMOTE_TARBALL", "REMOTE_ZIP"])
32
+ expect(KalibroGatekeeperClient::Entities::Repository.repository_types).to eq(["BAZAAR", "GIT", "MERCURIAL", "REMOTE_TARBALL", "REMOTE_ZIP"])
33
33
  end
34
34
  end
35
35
 
@@ -43,12 +43,12 @@ describe KalibroGatekeeperClient::Entities::Repository do
43
43
  end
44
44
 
45
45
  it 'should return an array' do
46
- KalibroGatekeeperClient::Entities::Repository.repositories_of(1).should be_an(Array)
46
+ expect(KalibroGatekeeperClient::Entities::Repository.repositories_of(1)).to be_an(Array)
47
47
  end
48
48
 
49
49
  it 'should set the repository_id' do
50
50
  KalibroGatekeeperClient::Entities::Repository.repositories_of(1).each do |repository|
51
- repository.project_id.should eq(1)
51
+ expect(repository.project_id).to eq(1)
52
52
  end
53
53
  end
54
54
  end
@@ -56,21 +56,21 @@ describe KalibroGatekeeperClient::Entities::Repository do
56
56
  describe "id=" do
57
57
  it 'should set the id attribute values as integer' do
58
58
  subject.id = "222"
59
- subject.id.should eq(222)
59
+ expect(subject.id).to eq(222)
60
60
  end
61
61
  end
62
62
 
63
63
  describe "process_period=" do
64
64
  it 'should set the process_period attribute values as integer' do
65
65
  subject.process_period = "222"
66
- subject.process_period.should eq(222)
66
+ expect(subject.process_period).to eq(222)
67
67
  end
68
68
  end
69
69
 
70
70
  describe "configuration_id=" do
71
71
  it 'should set the configuration_id attribute values as integer' do
72
72
  subject.configuration_id = "222"
73
- subject.configuration_id.should eq(222)
73
+ expect(subject.configuration_id).to eq(222)
74
74
  end
75
75
  end
76
76
 
@@ -112,7 +112,7 @@ describe KalibroGatekeeperClient::Entities::Repository do
112
112
  end
113
113
 
114
114
  it 'should list all the repositories' do
115
- KalibroGatekeeperClient::Entities::Repository.all.should include(subject)
115
+ expect(KalibroGatekeeperClient::Entities::Repository.all).to include(subject)
116
116
  end
117
117
  end
118
118
 
@@ -125,7 +125,7 @@ describe KalibroGatekeeperClient::Entities::Repository do
125
125
  end
126
126
 
127
127
  it 'should return the repository' do
128
- KalibroGatekeeperClient::Entities::Repository.find(subject.id).should eq(subject)
128
+ expect(KalibroGatekeeperClient::Entities::Repository.find(subject.id)).to eq(subject)
129
129
  end
130
130
  end
131
131
 
@@ -160,8 +160,8 @@ describe KalibroGatekeeperClient::Entities::Repository do
160
160
  end
161
161
 
162
162
  it 'should make a request to save model with id and return true without errors' do
163
- subject.save.should be(true)
164
- subject.kalibro_errors.should be_empty
163
+ expect(subject.save).to be(true)
164
+ expect(subject.kalibro_errors).to be_empty
165
165
  end
166
166
  end
167
167
 
@@ -174,7 +174,7 @@ describe KalibroGatekeeperClient::Entities::Repository do
174
174
  end
175
175
 
176
176
  it 'should return true' do
177
- KalibroGatekeeperClient::Entities::Repository.exists?(subject.id).should be_true
177
+ expect(KalibroGatekeeperClient::Entities::Repository.exists?(subject.id)).to be_truthy
178
178
  end
179
179
  end
180
180
 
@@ -184,7 +184,7 @@ describe KalibroGatekeeperClient::Entities::Repository do
184
184
  end
185
185
 
186
186
  it 'should return false' do
187
- KalibroGatekeeperClient::Entities::Repository.exists?(subject.id).should be_false
187
+ expect(KalibroGatekeeperClient::Entities::Repository.exists?(subject.id)).to be_falsey
188
188
  end
189
189
  end
190
190
  end
@@ -20,7 +20,7 @@ describe KalibroGatekeeperClient::Entities::StackTraceElement do
20
20
  describe 'line_number=' do
21
21
  it 'should set the line_number' do
22
22
  subject.line_number = 42
23
- subject.line_number.should eq(42)
23
+ expect(subject.line_number).to eq(42)
24
24
  end
25
25
  end
26
26
  end
@@ -22,21 +22,21 @@ describe KalibroGatekeeperClient::Entities::Throwable do
22
22
  describe 'stack_trace_element=' do
23
23
  it 'should set the stack trace element' do
24
24
  subject.stack_trace_element = stack_trace_element.to_hash
25
- subject.stack_trace_element.should eq([stack_trace_element])
25
+ expect(subject.stack_trace_element).to eq([stack_trace_element])
26
26
  end
27
27
  end
28
28
 
29
29
  describe 'stack_trace' do
30
30
  it 'should return the stack trace element' do
31
31
  subject.stack_trace_element = stack_trace_element.to_hash
32
- subject.stack_trace.should eq([stack_trace_element])
32
+ expect(subject.stack_trace).to eq([stack_trace_element])
33
33
  end
34
34
  end
35
35
 
36
36
  describe 'stack_trace=' do
37
37
  it 'should set the stack trace element' do
38
38
  subject.stack_trace = [stack_trace_element]
39
- subject.stack_trace_element.should eq([stack_trace_element])
39
+ expect(subject.stack_trace_element).to eq([stack_trace_element])
40
40
  end
41
41
  end
42
42
 
@@ -45,7 +45,7 @@ describe KalibroGatekeeperClient::Entities::Throwable do
45
45
 
46
46
  it 'should set the cause' do
47
47
  subject.cause = another_throwable.to_hash
48
- subject.cause.should eq(another_throwable)
48
+ expect(subject.cause).to eq(another_throwable)
49
49
  end
50
50
  end
51
51
  end
@@ -21,7 +21,7 @@ include AggregationOptions
21
21
 
22
22
  describe 'all_with_label' do
23
23
  it 'should return the list of aggregation methods available' do
24
- all_with_label.should eq(
24
+ expect(all_with_label).to eq(
25
25
  [
26
26
  ["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"],
27
27
  ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]
@@ -23,7 +23,7 @@ describe HashConverters do
23
23
  describe 'date_with_miliseconds' do
24
24
  context 'with 21/12/1995 (first Ruby publication)' do
25
25
  it 'should return 1995-12-21T00:00:00.0/1+00:00' do
26
- date_with_milliseconds(DateTime.parse("21/12/1995")).should eq("1995-12-21T00:00:00.0/1+00:00")
26
+ expect(date_with_milliseconds(DateTime.parse("21/12/1995"))).to eq("1995-12-21T00:00:00.0/1+00:00")
27
27
  end
28
28
  end
29
29
  end
@@ -31,7 +31,7 @@ describe HashConverters do
31
31
  describe 'convert_to_hash' do
32
32
  context 'with a nil value' do
33
33
  it 'should return nil' do
34
- convert_to_hash(nil).should be_nil
34
+ expect(convert_to_hash(nil)).to be_nil
35
35
  end
36
36
  end
37
37
 
@@ -44,7 +44,7 @@ describe HashConverters do
44
44
  end
45
45
 
46
46
  it 'should return the Array wth its elements converted' do
47
- convert_to_hash(@array)[0].should eq(@element1.to_s)
47
+ expect(convert_to_hash(@array)[0]).to eq(@element1.to_s)
48
48
  end
49
49
  end
50
50
 
@@ -54,7 +54,7 @@ describe HashConverters do
54
54
  end
55
55
 
56
56
  it "should return the Model's Hash" do
57
- convert_to_hash(@model).should eq(@model.to_hash)
57
+ expect(convert_to_hash(@model)).to eq(@model.to_hash)
58
58
  end
59
59
  end
60
60
 
@@ -64,19 +64,19 @@ describe HashConverters do
64
64
  end
65
65
 
66
66
  it 'should return th date with miliseconds' do
67
- convert_to_hash(@date).should eq(date_with_milliseconds(@date))
67
+ expect(convert_to_hash(@date)).to eq(date_with_milliseconds(@date))
68
68
  end
69
69
  end
70
70
 
71
71
  context 'with an + infinite Float' do
72
72
  it 'should return INF' do
73
- convert_to_hash(1.0/0.0).should eq('INF')
73
+ expect(convert_to_hash(1.0/0.0)).to eq('INF')
74
74
  end
75
75
  end
76
76
 
77
77
  context 'with an - infinite Float' do
78
78
  it 'should return -INF' do
79
- convert_to_hash(-1.0/0.0).should eq('-INF')
79
+ expect(convert_to_hash(-1.0/0.0)).to eq('-INF')
80
80
  end
81
81
  end
82
82
  end
@@ -89,11 +89,11 @@ describe HashConverters do
89
89
  end
90
90
 
91
91
  it 'should return an instance of Hash' do
92
- @model.field_to_hash(:field_getter).should be_a(Hash)
92
+ expect(@model.field_to_hash(:field_getter)).to be_a(Hash)
93
93
  end
94
94
 
95
95
  it 'should return an empty Hash' do
96
- @model.field_to_hash(:field_getter).should eq({})
96
+ expect(@model.field_to_hash(:field_getter)).to eq({})
97
97
  end
98
98
  end
99
99
 
@@ -104,7 +104,7 @@ describe HashConverters do
104
104
  end
105
105
 
106
106
  it 'should return an instance of Hash' do
107
- @model.field_to_hash(:field_getter).should be_a(Hash)
107
+ expect(@model.field_to_hash(:field_getter)).to be_a(Hash)
108
108
  end
109
109
  end
110
110
  end
@@ -24,7 +24,7 @@ describe XMLConverters do
24
24
  before { @model = KalibroGatekeeperClient::Entities::Model.new }
25
25
 
26
26
  it 'should return modelXml' do
27
- xml_instance_class_name(@model).should eq('modelXml')
27
+ expect(xml_instance_class_name(@model)).to eq('modelXml')
28
28
  end
29
29
  end
30
30
 
@@ -33,11 +33,11 @@ describe XMLConverters do
33
33
  before { @object = "kalibro" }
34
34
 
35
35
  it 'should return a Hash' do
36
- get_xml("field", @object).should be_a(Hash)
36
+ expect(get_xml("field", @object)).to be_a(Hash)
37
37
  end
38
38
 
39
39
  it 'should return an empty Hash' do
40
- get_xml("field", @object).should eq({})
40
+ expect(get_xml("field", @object)).to eq({})
41
41
  end
42
42
  end
43
43
 
@@ -45,7 +45,7 @@ describe XMLConverters do
45
45
  before { @object = KalibroGatekeeperClient::Entities::Model.new }
46
46
 
47
47
  it 'should return a Hash' do
48
- get_xml("field", @object).should be_a(Hash)
48
+ expect(get_xml("field", @object)).to be_a(Hash)
49
49
  end
50
50
 
51
51
  it 'should return the XML Hash' do
@@ -57,7 +57,7 @@ describe XMLConverters do
57
57
  }
58
58
  }
59
59
 
60
- get_xml("field", @object).should eq(field_xml_hash)
60
+ expect(get_xml("field", @object)).to eq(field_xml_hash)
61
61
  end
62
62
  end
63
63
  end