kalibro_entities 0.0.1.rc1 → 0.0.1.rc2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 835c1a1132b71f89e17a54e180c23a067170d1f8
4
- data.tar.gz: b5dbf567c3dd326c3c59739b842700ed9270c3be
3
+ metadata.gz: 6e9edda347982594065e1c53d5c9424556ed3986
4
+ data.tar.gz: f7bc5a083e9bf5e4ba3fb077a516f1ae56df0ac9
5
5
  SHA512:
6
- metadata.gz: 1cc9c564154151754f9c40145e516eefa398dbb3c96d61364156999cad3d03b2ef8169510861748735981dba65b1bf29b9d7fa741784a9c6125867c9c6164f5a
7
- data.tar.gz: 008e9af51f75ab4e02af1bf27cd1dffb8005dbbd20c2d590af6e39d2da39203f3e4ba7ffdd4684669489cbdf143166e01adc1e60ed615a08fbcd8334ab8cdca1
6
+ metadata.gz: 4f6fd4e2b6d87a3de9015701558b0a80311350edbf6d763ff5eaaacbf205f44f31d1c906bc03c20b14cd83b13a8ed318637ae03665142f535d6be5844a0a4e61
7
+ data.tar.gz: fae1c8de24be60a989e28e876b08f2e09e6b9f623aa90d0d6bab9240c4755eaa994c1d025525abbd1e013e604f51a95de7f7d979af78abdcd5932fa55c4302a4
@@ -0,0 +1,14 @@
1
+ Feature: Repositories listing
2
+ In order to be able to check know if a repository still exists
3
+ As a developer
4
+ I want to check that on the service
5
+
6
+ @kalibro_restart
7
+ Scenario: With existing project repository
8
+ Given I have a project with name "Kalibro"
9
+ And I have a configuration with name "Java"
10
+ And the given project has the following Repositories:
11
+ | name | type | address |
12
+ | "Kalibro" | GIT | https://github.com/mezuro/kalibro.git |
13
+ When I ask to check if the given repository exists
14
+ Then I should get true
@@ -31,6 +31,10 @@ When(/^I ask to find the given repository$/) do
31
31
  @response = KalibroEntities::Entities::Repository.find(@repository.id)
32
32
  end
33
33
 
34
+ When(/^I ask to check if the given repository exists$/) do
35
+ @response = KalibroEntities::Entities::Repository.exists?(@repository.id)
36
+ end
37
+
34
38
  Then(/^I should get success$/) do
35
39
  @response == true
36
40
  end
@@ -68,6 +68,14 @@ module KalibroEntities
68
68
  raise KalibroEntities::Errors::RecordNotFound
69
69
  end
70
70
 
71
+ def self.exists?(id)
72
+ begin
73
+ return true unless find(id).nil?
74
+ rescue KalibroEntities::Errors::RecordNotFound
75
+ return false
76
+ end
77
+ end
78
+
71
79
  private
72
80
 
73
81
  def save_params
@@ -15,5 +15,5 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
  module KalibroEntities
18
- VERSION = "0.0.1.rc1"
18
+ VERSION = "0.0.1.rc2"
19
19
  end
@@ -80,7 +80,7 @@ describe KalibroEntities::Entities::Repository do
80
80
  expects(:request).
81
81
  with(:process_repository, {:repository_id => subject.id})
82
82
  end
83
-
83
+
84
84
  it 'should call the request method' do
85
85
  subject.process
86
86
  end
@@ -164,4 +164,28 @@ describe KalibroEntities::Entities::Repository do
164
164
  subject.kalibro_errors.should be_empty
165
165
  end
166
166
  end
167
+
168
+ describe 'exists?' do
169
+ subject {FactoryGirl.build(:repository)}
170
+
171
+ context 'when the repository exists' do
172
+ before :each do
173
+ KalibroEntities::Entities::Repository.expects(:find).with(subject.id).returns(subject)
174
+ end
175
+
176
+ it 'should return true' do
177
+ KalibroEntities::Entities::Repository.exists?(subject.id).should be_true
178
+ end
179
+ end
180
+
181
+ context 'when the repository does not exists' do
182
+ before :each do
183
+ KalibroEntities::Entities::Repository.expects(:find).with(subject.id).raises(KalibroEntities::Errors::RecordNotFound)
184
+ end
185
+
186
+ it 'should return false' do
187
+ KalibroEntities::Entities::Repository.exists?(subject.id).should be_false
188
+ end
189
+ end
190
+ end
167
191
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kalibro_entities
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.rc1
4
+ version: 0.0.1.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Morais
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2013-10-16 00:00:00.000000000 Z
18
+ date: 2013-10-17 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bundler
@@ -218,6 +218,7 @@ files:
218
218
  - features/reading_group/all.feature
219
219
  - features/repository/all.feature
220
220
  - features/repository/cancel_processing.feature
221
+ - features/repository/exists.feature
221
222
  - features/repository/find.feature
222
223
  - features/repository/of.feature
223
224
  - features/repository/process.feature
@@ -349,7 +350,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
349
350
  version: 1.3.1
350
351
  requirements: []
351
352
  rubyforge_project:
352
- rubygems_version: 2.0.3
353
+ rubygems_version: 2.0.5
353
354
  signing_key:
354
355
  specification_version: 4
355
356
  summary: KalibroEntites is a communication interface with the Kalibro service.
@@ -389,6 +390,7 @@ test_files:
389
390
  - features/reading_group/all.feature
390
391
  - features/repository/all.feature
391
392
  - features/repository/cancel_processing.feature
393
+ - features/repository/exists.feature
392
394
  - features/repository/find.feature
393
395
  - features/repository/of.feature
394
396
  - features/repository/process.feature