kalibro_client 1.0.0 → 1.1.0

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: b71716183bdffd5a09ffdab9ff0f7807281f4983
4
- data.tar.gz: 7485250e6703227bcef08cc18169bf38400920ac
3
+ metadata.gz: 898bf1fce5f6d3c85b0c2e11e9e8f378f1bfc2e4
4
+ data.tar.gz: a25aaa22d3f6b64a04ff42a174e730cf230a7c35
5
5
  SHA512:
6
- metadata.gz: be9d54132f013e1995fad8f2697101fe31d59438872bf4c4247514811a534a7b94bbde4268c83d63c70e98bb7fbd2350b880255f5efde8f3992ad2a2f49adf75
7
- data.tar.gz: f5d3e9a1091943f7831e10067a25aabb01fffaf352a43746c2073be36bba7c949eadd1a08d4dd70ed0bbfc0b50b3d6a8a7e4b55170e0459158e704da1ed2117c
6
+ metadata.gz: f6a8c927614532f3eb376b14c074bcc60277ee1460acc729838c04b8144c49094fc9da631140544071b00913ad9ac56b6a9004f3f66a192ac3bcc62fd1b7dd53
7
+ data.tar.gz: 7ec5f6c9d83e108e80f9013022929e0d8a013dbe4ab208ebcfa5a40dac3a001b08513a75d56d653543c27e1c99db211eed6ce8516bffc227b078c05fca06994b
data/.travis.yml CHANGED
@@ -6,7 +6,7 @@ addons:
6
6
  postgresql: "9.3"
7
7
 
8
8
  before_script:
9
- - git clone https://github.com/mezuro/kalibro_install.git -b v2.5 kalibro_install
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 repository
15
+ Then the response should contain the given repositories
@@ -1,4 +1,6 @@
1
-
1
+ Given(/^I have an independent repository$/) do
2
+ @independent_repository = FactoryGirl.create(:repository, project_id: nil)
3
+ end
2
4
 
3
5
  Given(/^the given project has the following Repositories:$/) do |table|
4
6
  hash = table.hashes.first
@@ -59,8 +61,9 @@ Then(/^I should get the given repository$/) do
59
61
  expect(@response).to eq(@repository)
60
62
  end
61
63
 
62
- Then(/^the response should contain the given repository$/) do
63
- expect(@response.first.project_id).to eq(@project.id)
64
+ Then(/^the response should contain the given repositories$/) do
65
+ expect(@response).to include(@repository)
66
+ expect(@response).to include(@independent_repository)
64
67
  end
65
68
 
66
69
  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, :send_email, :code_directory, :branch
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
- projects = Project.all
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)
@@ -15,5 +15,5 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
  module KalibroClient
18
- VERSION = "1.0.0"
18
+ VERSION = "1.1.0"
19
19
  end
@@ -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" => nil)).to eq([])
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' => nil})
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' => nil})
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' => nil})
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' => nil}.to_json)
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" => nil})
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" => nil})
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(:repositories_of).
111
- with(project.id).
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
@@ -24,7 +24,8 @@ FactoryGirl.define do
24
24
  address "svn://svn.code.sf.net/p/qt-calculator/code/trunk"
25
25
  kalibro_configuration_id 1
26
26
  project_id 1
27
- send_email "test@test.com"
27
+ branch "master"
28
+ code_directory nil
28
29
 
29
30
  trait :with_id do
30
31
  id 1
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: 1.0.0
4
+ version: 1.1.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-26 00:00:00.000000000 Z
14
+ date: 2015-07-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler