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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a4214e47a7f3f799e57cfc42bcb8228c30e47ab
4
- data.tar.gz: 160530db52e0e23314b39c2d59cdb353356dfe39
3
+ metadata.gz: 4e7df405fbb5caaf2ed0998437a1e6a4ef66b74e
4
+ data.tar.gz: c6123a2a752d3750f33e04f428395b5bf98c1bb6
5
5
  SHA512:
6
- metadata.gz: 374887c5ff39d2947fe927eae6d72191b1e032aec1fc51d8dbfda556a0d7c6ec9bb759e5300cd3e92fbe26d0e81e7fbf9faf2aff63cff3e4c970b59072666146
7
- data.tar.gz: 8fc36b576b67406ce212ad25399dfdcd31ffdd8e8b603431d2887da3b91acd722b20b1e9a79202a2604f42862d428c4fc1c1b8418c2b13325806e1673921537d
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://gist.github.com/6179925.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,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 repository$/) do
61
- expect(@response.first.project_id).to eq(@project.id)
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, :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 = "0.3.0"
18
+ VERSION = "0.4.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: 0.3.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-15 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