kalibro_entities 0.0.1.rc4 → 0.0.1.rc5

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: dfd0bba8a6a0fd21edd89f846ee569a0ff2eda3a
4
- data.tar.gz: 61cf1255dec08c90a1e4845a42f9ca90dcdb1e66
3
+ metadata.gz: 7af71147478b55623123dcc45c0e6c03f66b6d4a
4
+ data.tar.gz: acaae54ac70e6b87fb30ec2d993ac1a48b603b8b
5
5
  SHA512:
6
- metadata.gz: 170988f3bacedb74ec5538cc825ef0f974015f97f5403eb2c9422ebef78ca194de34774401c21fc239685394e8045e8e6ce9f01690ddc34afd78854b2342b5d5
7
- data.tar.gz: 5fc92926c881433657149be51e08694cef6db09ff6265a0e49ff59c7bdbb5d0df4193f3b30a8040992e2966c9d0ab7e66a330a5c490dddf71a51801f3d1764e8
6
+ metadata.gz: 4bdef2889298da56f0f602826ec0bd2b21e07e234a80df99f7636c24f2a7f787280c166523b913284071578d338cab5bfde3d301c8529dc01c8832626b7aa6e3
7
+ data.tar.gz: 8decbcc7bda2e2b4a73b603962e0e4703103c5f0fe32b8ae5a747fb048019b7226d89696f3b2f5308cf34c41f12fc46851cae73f1679f756caf56c26b8b4881f
@@ -60,6 +60,14 @@ module KalibroEntities
60
60
  @parent_id = value.to_i
61
61
  end
62
62
 
63
+ def folder?
64
+ self.children.count > 0
65
+ end
66
+
67
+ def file?
68
+ !self.folder?
69
+ end
70
+
63
71
  def self.history_of(module_result_id)
64
72
  response = self.create_array_from_hash self.request(:history_of_module, {:module_result_id => module_result_id})[:date_module_result]
65
73
  response.map {|date_module_result| KalibroEntities::Entities::DateModuleResult.new date_module_result}
@@ -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.rc4"
18
+ VERSION = "0.0.1.rc5"
19
19
  end
@@ -119,7 +119,7 @@ describe KalibroEntities::Entities::ModuleResult do
119
119
  end
120
120
 
121
121
  describe 'history_of' do
122
- let(:date_module_result) { FactoryGirl.build(:date_module_result) }
122
+ let(:date_module_result) { FactoryGirl.build(:date_module_result) }
123
123
  before :each do
124
124
  KalibroEntities::Entities::ModuleResult.
125
125
  expects(:request).
@@ -132,4 +132,32 @@ describe KalibroEntities::Entities::ModuleResult do
132
132
  date_module_results.first.result.should eq date_module_result.result
133
133
  end
134
134
  end
135
+
136
+ describe 'folder? & file?' do
137
+ context 'when the module result has childrens' do
138
+ subject { FactoryGirl.build(:root_module_result) }
139
+
140
+ before :each do
141
+ subject.expects(:children).twice.returns([FactoryGirl.build(:module_result)])
142
+ end
143
+
144
+ it 'should return true for folder? and false for file?' do
145
+ subject.folder?.should be_true
146
+ subject.file?.should be_false
147
+ end
148
+ end
149
+
150
+ context 'when the module result has no childrens' do
151
+ subject { FactoryGirl.build(:module_result) }
152
+
153
+ before :each do
154
+ subject.expects(:children).twice.returns([])
155
+ end
156
+
157
+ it 'should return true for folder? and false for file?' do
158
+ subject.folder?.should be_false
159
+ subject.file?.should be_true
160
+ end
161
+ end
162
+ end
135
163
  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.rc4
4
+ version: 0.0.1.rc5
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-28 00:00:00.000000000 Z
18
+ date: 2013-10-29 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bundler
@@ -350,7 +350,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
350
350
  version: 1.3.1
351
351
  requirements: []
352
352
  rubyforge_project:
353
- rubygems_version: 2.0.5
353
+ rubygems_version: 2.0.3
354
354
  signing_key:
355
355
  specification_version: 4
356
356
  summary: KalibroEntites is a communication interface with the Kalibro service.