kalibro_client 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/features/repository/all.feature +2 -1
- data/features/step_definitions/repository_steps.rb +6 -2
- data/lib/kalibro_client/entities/processor/repository.rb +2 -9
- data/lib/kalibro_client/version.rb +1 -1
- data/spec/entities/base_spec.rb +1 -1
- data/spec/entities/configurations/kalibro_configuration_spec.rb +1 -1
- data/spec/entities/configurations/kalibro_range_spec.rb +1 -1
- data/spec/entities/configurations/reading_group_spec.rb +1 -1
- data/spec/entities/processor/metric_collector_details_spec.rb +2 -2
- data/spec/entities/processor/project_spec.rb +2 -2
- data/spec/entities/processor/repository_spec.rb +3 -8
- data/spec/factories/repositories.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e7df405fbb5caaf2ed0998437a1e6a4ef66b74e
|
4
|
+
data.tar.gz: c6123a2a752d3750f33e04f428395b5bf98c1bb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44c1230696f6f271e0619473edad2700caf0c3f34f9b8f2ea1ff4df3fc77efb300c91b386c4671e7e909b4ac106ea1b3884246dec111831098ebea5f9044f25c
|
7
|
+
data.tar.gz: 8011b114efdaf7ce12c0e2f234aeaae49d99e80c19c8d0d912b57b027d7da9e519a233105f5a6e11b10eb8d42f27f22250d0274e6de25d63fc0b3055db63126c
|
data/.travis.yml
CHANGED
@@ -6,7 +6,7 @@ addons:
|
|
6
6
|
postgresql: "9.3"
|
7
7
|
|
8
8
|
before_script:
|
9
|
-
- git clone https://
|
9
|
+
- git clone https://github.com/mezuro/kalibro_install.git -b v2.6 kalibro_install
|
10
10
|
- pushd kalibro_install
|
11
11
|
# Remove bugged libzmq3 package, see https://github.com/travis-ci/travis-ci/issues/982 and https://github.com/travis-ci/travis-ci/issues/1715 for details
|
12
12
|
- sudo apt-get remove libzmq3
|
@@ -10,5 +10,6 @@ Feature: Repositories listing
|
|
10
10
|
And the given project has the following Repositories:
|
11
11
|
| name | scm_type | address |
|
12
12
|
| Kalibro | GIT | https://github.com/rafamanzo/runge-kutta-vtk.git |
|
13
|
+
And I have an independent repository
|
13
14
|
When I ask for all the repositories
|
14
|
-
Then the response should contain the given
|
15
|
+
Then the response should contain the given repositories
|
@@ -1,3 +1,6 @@
|
|
1
|
+
Given(/^I have an independent repository$/) do
|
2
|
+
@independent_repository = FactoryGirl.create(:repository, project_id: nil)
|
3
|
+
end
|
1
4
|
Given(/^the given project has the following Repositories:$/) do |table|
|
2
5
|
hash = table.hashes.first
|
3
6
|
hash[:project_id] = @project.id
|
@@ -57,8 +60,9 @@ Then(/^I should get the given repository$/) do
|
|
57
60
|
expect(@response).to eq(@repository)
|
58
61
|
end
|
59
62
|
|
60
|
-
Then(/^the response should contain the given
|
61
|
-
expect(@response
|
63
|
+
Then(/^the response should contain the given repositories$/) do
|
64
|
+
expect(@response).to include(@repository)
|
65
|
+
expect(@response).to include(@independent_repository)
|
62
66
|
end
|
63
67
|
|
64
68
|
Then(/^the repositories should contain the project id$/) do
|
@@ -19,7 +19,7 @@ module KalibroClient
|
|
19
19
|
module Processor
|
20
20
|
class Repository < KalibroClient::Entities::Processor::Base
|
21
21
|
|
22
|
-
attr_accessor :id, :name, :description, :license, :period, :scm_type, :address, :kalibro_configuration_id, :project_id, :
|
22
|
+
attr_accessor :id, :name, :description, :license, :period, :scm_type, :address, :kalibro_configuration_id, :project_id, :code_directory, :branch
|
23
23
|
|
24
24
|
def self.repository_types
|
25
25
|
request('types', {}, :get)['types'].to_a
|
@@ -113,14 +113,7 @@ module KalibroClient
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def self.all
|
116
|
-
|
117
|
-
repositories = []
|
118
|
-
|
119
|
-
projects.each do |project|
|
120
|
-
repositories.concat(repositories_of(project.id))
|
121
|
-
end
|
122
|
-
|
123
|
-
return repositories
|
116
|
+
create_objects_array_from_hash(request("", {}, :get))
|
124
117
|
end
|
125
118
|
|
126
119
|
def self.branches(url, scm_type)
|
data/spec/entities/base_spec.rb
CHANGED
@@ -356,7 +356,7 @@ describe KalibroClient::Entities::Base do
|
|
356
356
|
describe 'create_objects_array_from_hash' do
|
357
357
|
context 'with nil' do
|
358
358
|
it 'should return an empty array' do
|
359
|
-
expect(KalibroClient::Entities::Base.create_objects_array_from_hash("bases" =>
|
359
|
+
expect(KalibroClient::Entities::Base.create_objects_array_from_hash("bases" => [])).to eq([])
|
360
360
|
end
|
361
361
|
end
|
362
362
|
|
@@ -30,7 +30,7 @@ describe KalibroClient::Entities::Configurations::KalibroConfiguration do
|
|
30
30
|
KalibroClient::Entities::Configurations::KalibroConfiguration.
|
31
31
|
expects(:request).
|
32
32
|
with('', {}, :get).
|
33
|
-
returns({'kalibro_configurations' =>
|
33
|
+
returns({'kalibro_configurations' => []})
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'should return nil' do
|
@@ -76,7 +76,7 @@ describe KalibroClient::Entities::Configurations::KalibroRange do
|
|
76
76
|
KalibroClient::Entities::Configurations::KalibroRange.
|
77
77
|
expects(:request).
|
78
78
|
with('', {}, :get, "metric_configurations/#{metric_configuration.id}").
|
79
|
-
returns({'ranges' =>
|
79
|
+
returns({'ranges' => []})
|
80
80
|
end
|
81
81
|
|
82
82
|
it 'should return a list with the ranges' do
|
@@ -32,7 +32,7 @@ describe KalibroClient::Entities::Configurations::ReadingGroup do
|
|
32
32
|
KalibroClient::Entities::Configurations::ReadingGroup.
|
33
33
|
expects(:request).
|
34
34
|
with('', {}, :get).
|
35
|
-
returns({'reading_groups' =>
|
35
|
+
returns({'reading_groups' => []})
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'should return nil' do
|
@@ -23,7 +23,7 @@ describe KalibroClient::Entities::Processor::MetricCollectorDetails do
|
|
23
23
|
KalibroClient::Entities::Processor::MetricCollectorDetails.
|
24
24
|
expects(:request).
|
25
25
|
with(:names, {}, :get).
|
26
|
-
returns({'names' =>
|
26
|
+
returns({'names' => []})
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'should return empty array' do
|
@@ -58,7 +58,7 @@ describe KalibroClient::Entities::Processor::MetricCollectorDetails do
|
|
58
58
|
KalibroClient::Entities::Processor::MetricCollectorDetails.
|
59
59
|
expects(:request).
|
60
60
|
with('', {}, :get).
|
61
|
-
returns({"metric_collector_details" =>
|
61
|
+
returns({"metric_collector_details" => []})
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'should return empty array' do
|
@@ -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
|
@@ -37,7 +37,7 @@ describe KalibroClient::Entities::Processor::Project do
|
|
37
37
|
KalibroClient::Entities::Processor::Project.
|
38
38
|
expects(:request).
|
39
39
|
with('', {}, :get).
|
40
|
-
returns({"projects" =>
|
40
|
+
returns({"projects" => []})
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'should return nil' do
|
@@ -100,16 +100,11 @@ describe KalibroClient::Entities::Processor::Repository do
|
|
100
100
|
end
|
101
101
|
|
102
102
|
describe 'all' do
|
103
|
-
let(:project) { FactoryGirl.build(:project) }
|
104
|
-
|
105
103
|
before :each do
|
106
|
-
KalibroClient::Entities::Processor::Project.
|
107
|
-
expects(:all).
|
108
|
-
returns([project])
|
109
104
|
KalibroClient::Entities::Processor::Repository.
|
110
|
-
expects(:
|
111
|
-
with(
|
112
|
-
returns([subject])
|
105
|
+
expects(:request).
|
106
|
+
with("", {}, :get).
|
107
|
+
returns({'repositories' => [subject.to_hash]})
|
113
108
|
end
|
114
109
|
|
115
110
|
it 'should list all the repositories' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kalibro_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Quadros Miranda
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-06
|
14
|
+
date: 2015-07-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|