kalibro_gatekeeper_client 0.0.1.rc2 → 0.0.1.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9dc3c590ad139a3b7402633e67093ccb8294c5f
4
- data.tar.gz: 00ca689a681c74707858173959b5159348742876
3
+ metadata.gz: 4088a08bf5ac558f77fd6ebee603f271d148fc0d
4
+ data.tar.gz: 189a912b6f9b031ebf0a3afd62d2c71ced9a357e
5
5
  SHA512:
6
- metadata.gz: 76db05af4af838a520526fe0e5bbadd0dc7f690104431176a11166c35d635d2fef16056b013e08d506eee928aaa0f6647c0f6303c2cb23be9c0e2124921131b2
7
- data.tar.gz: e25a667910760d6c5cc52ba6d4a724396a8d52651d8ff086c148681951e241e9cde4e467178ec2294c54ddc80fdeb903437d3001ed74795f05f7071c2caf9a24
6
+ metadata.gz: 711e7ccbe2309a66a39d3c8e20f0a5e39bd2bb447b58d28bd21a4710dcb665a595382a1fea8c8b8d6d1bf132eed96579b722f2f3890ba5efefdc5f950714d0b7
7
+ data.tar.gz: 4908323c1aa5bae2a919f6e22b6ee3040daf9cdd811289390cd9c3402de914a36679e43c8124937f0aa3459cb7e9055c077c73e6e75097c71ec1e024cf40df7a
@@ -53,8 +53,11 @@ module KalibroGatekeeperClient
53
53
 
54
54
  def save
55
55
  begin
56
- self.id = self.class.request(save_action, save_params)["id"]
57
- true
56
+ response = self.class.request(save_action, save_params)
57
+ self.id = response["id"]
58
+ self.kalibro_errors = response["kalibro_errors"]
59
+
60
+ self.kalibro_errors.empty? ? true : false
58
61
  rescue Exception => exception
59
62
  add_error exception
60
63
  false
@@ -15,5 +15,5 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
  module KalibroGatekeeperClient
18
- VERSION = "0.0.1.rc2"
18
+ VERSION = "0.0.1.rc3"
19
19
  end
@@ -5,7 +5,7 @@
5
5
  # it under the terms of the GNU General Public License as published by
6
6
  # the Free Software Foundation, either version 3 of the License, or
7
7
  # (at your option) any later version.
8
- #
8
+ #
9
9
  # This program is distributed in the hope that it will be useful,
10
10
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -33,7 +33,7 @@ describe KalibroGatekeeperClient::Entities::MetricConfiguration do
33
33
 
34
34
  describe 'metric=' do
35
35
  let(:metric) { FactoryGirl.build(:metric) }
36
-
36
+
37
37
  before :each do
38
38
  KalibroGatekeeperClient::Entities::Metric.
39
39
  expects(:to_object).at_least_once.
@@ -56,7 +56,7 @@ describe KalibroGatekeeperClient::Entities::MetricConfiguration do
56
56
 
57
57
  describe 'update_attributes' do
58
58
  let(:metric_configuration) { FactoryGirl.build(:metric_configuration) }
59
-
59
+
60
60
  before :each do
61
61
  KalibroGatekeeperClient::Entities::MetricConfiguration.any_instance.
62
62
  expects(:save).
@@ -104,7 +104,7 @@ describe KalibroGatekeeperClient::Entities::MetricConfiguration do
104
104
  KalibroGatekeeperClient::Entities::MetricConfiguration.
105
105
  expects(:request).
106
106
  with('save', {:metric_configuration => subject.to_hash, :configuration_id => subject.configuration_id}).
107
- returns({'id' => 1})
107
+ returns({'id' => 1, 'kalibro_errors' => []})
108
108
  end
109
109
 
110
110
  it 'should make a request to save model with id and return true without errors' do
@@ -119,7 +119,7 @@ describe KalibroGatekeeperClient::Entities::Model do
119
119
  before :each do
120
120
  KalibroGatekeeperClient::Entities::Model.
121
121
  expects(:request).
122
- with('save', {model: {}}).returns({'id' => 42})
122
+ with('save', {model: {}}).returns({'id' => 42, 'kalibro_errors' => []})
123
123
  end
124
124
 
125
125
  context "when it doesn't have the method id=" do
@@ -142,7 +142,7 @@ describe KalibroGatekeeperClient::Entities::Range do
142
142
  KalibroGatekeeperClient::Entities::Range.
143
143
  expects(:request).
144
144
  with('save', {:range => subject.to_hash, :metric_configuration_id => subject.metric_configuration_id}).
145
- returns({'id' => 2})
145
+ returns({'id' => 2, 'kalibro_errors' => []})
146
146
  end
147
147
 
148
148
  it 'should make a request to save model with id and return true without errors' do
@@ -69,7 +69,7 @@ describe KalibroGatekeeperClient::Entities::Reading do
69
69
 
70
70
  describe 'readings_of' do
71
71
  let(:reading_group) { FactoryGirl.build(:reading_group) }
72
-
72
+
73
73
  before do
74
74
  KalibroGatekeeperClient::Entities::Reading.
75
75
  expects(:request).
@@ -107,12 +107,12 @@ describe KalibroGatekeeperClient::Entities::Reading do
107
107
  describe 'save' do
108
108
  let(:reading) { FactoryGirl.build(:reading, {id: nil, group_id: FactoryGirl.build(:reading_group).id}) }
109
109
  let(:reading_id) { 73 }
110
-
110
+
111
111
  before :each do
112
112
  KalibroGatekeeperClient::Entities::Reading.
113
113
  expects(:request).
114
114
  with('save', {reading: reading.to_hash, reading_group_id: reading.group_id}).
115
- returns({'id' => reading_id})
115
+ returns({'id' => reading_id, 'kalibro_errors' => []})
116
116
  end
117
117
 
118
118
  it 'should make a request to save model with id and return true without errors' do
@@ -151,7 +151,7 @@ describe KalibroGatekeeperClient::Entities::Repository do
151
151
  KalibroGatekeeperClient::Entities::Repository.
152
152
  expects(:request).
153
153
  with('save', {:repository => subject.to_hash, :project_id => 1}).
154
- returns({'id' => 1})
154
+ returns({'id' => 1, 'kalibro_errors' => []})
155
155
 
156
156
  KalibroGatekeeperClient::Entities::Repository.any_instance.
157
157
  expects(:id=).
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kalibro_gatekeeper_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.rc2
4
+ version: 0.0.1.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Araújo Martinez
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-03-25 00:00:00.000000000 Z
14
+ date: 2014-03-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler