occi-core 4.2.7 → 4.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/occi/core/entity.rb +2 -1
- data/lib/occi/version.rb +1 -1
- data/spec/occi/core/entity_spec.rb +11 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NmRlZjVhZmQ5ZDQ2MjE2NzQwMGNiMmYwNGMxOGY0M2ZiZTljM2Q3ZQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fe9f229bab5b1ec66e0bde20117f04809e49fc3c
|
4
|
+
data.tar.gz: 6c198e622744e85891327bb44eb3c59768aef3d6
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
MDc4YWE3ZTM1ZDU5NGNmNzY0Njk0NDg3NzI1NDk2N2YyZTUzYjUxNjJlOTNl
|
11
|
-
MGE2MTFmMjk1M2QxODUxYTg1NDMyMGRmODgwOTA4YTUwM2FiZTE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZDFjMmViMmRlMDk0YjAxNjcwNWM1NjgwMDA1MWViY2FiYTkzMmNkMDgwNjkx
|
14
|
-
M2E2Mjk2MTY5MzhjOTE5OGNjZThhY2M5OTlkMTVhZmQxZDljY2E3MmUxNTZi
|
15
|
-
OGMwODg1YzM5YTMwMGJiYTQ0ZjNlYjYwOTUyZDViN2Q3ZGJlYjA=
|
6
|
+
metadata.gz: 4d6db094b91ba1b68846a6fb2f750a5096c61d75e1a87392fa1eb1b7387cd5892b7b77d43a9a863425344167097e5c10fa61d17369f076ceb3fd570e652c448e
|
7
|
+
data.tar.gz: def0771cdaa027734d13cdb23155da859d157fa0ef40eaf2741896eb0e782cb3d5af1aac453e3f9db792423da51ae692e54b432de9dc215593cce49281a90423
|
data/lib/occi/core/entity.rb
CHANGED
@@ -170,7 +170,8 @@ module Occi
|
|
170
170
|
|
171
171
|
@mixins.each do |mxn|
|
172
172
|
mixin = @model.get_by_id(mxn.to_s)
|
173
|
-
|
173
|
+
raise Occi::Errors::CategoryNotDefinedError,
|
174
|
+
"Mixin #{mxn.to_s.inspect} not declared in the model!" unless mixin && mixin.kind_of?(Occi::Core::Mixin)
|
174
175
|
|
175
176
|
definitions.merge!(mixin.attributes) if mixin.attributes
|
176
177
|
end if @mixins
|
data/lib/occi/version.rb
CHANGED
@@ -210,6 +210,7 @@ Link: </TestLoc/1?action=testaction>;rel="http://schemas.ogf.org/occi/core/entit
|
|
210
210
|
:mutable => true }
|
211
211
|
defmixin }
|
212
212
|
let(:mixin){ Occi::Core::Mixin.new 'http://schemas.ogf.org/occi/core#', 'testmixin' }
|
213
|
+
let(:undefmixin){ Occi::Core::Mixin.new 'http://schemas.ogf.org/occi/core#', 'fake_mixin' }
|
213
214
|
|
214
215
|
let(:entity){ entity = Occi::Core::Entity.new(kind, [], defs)
|
215
216
|
entity.model = model
|
@@ -220,11 +221,13 @@ Link: </TestLoc/1?action=testaction>;rel="http://schemas.ogf.org/occi/core/entit
|
|
220
221
|
before(:each){ Occi::Settings['compatibility']=false
|
221
222
|
Occi::Settings['verify_attribute_pattern']=true }
|
222
223
|
after(:each) { Occi::Settings.reload! }
|
224
|
+
|
223
225
|
context 'unsupported types' do
|
224
226
|
it 'refuses unsupported type' do
|
225
227
|
expect{ entity.attributes['othertype'] = { :type => 'other', :default => 'defaultvalue' } }.to raise_exception(Occi::Errors::AttributePropertyTypeError)
|
226
228
|
end
|
227
229
|
end
|
230
|
+
|
228
231
|
context 'defaults' do
|
229
232
|
context 'setting defaults' do
|
230
233
|
it 'sets numeric default' do
|
@@ -292,12 +295,19 @@ Link: </TestLoc/1?action=testaction>;rel="http://schemas.ogf.org/occi/core/entit
|
|
292
295
|
expect{ ent.check(true) }.to raise_exception ArgumentError
|
293
296
|
end
|
294
297
|
|
295
|
-
it 'raises exception for
|
298
|
+
it 'raises exception for nonexistent kind' do
|
296
299
|
ent = Occi::Core::Entity.new(kind, [], defs)
|
297
300
|
mod = Occi::Model.new
|
298
301
|
ent.model = mod
|
299
302
|
expect{ ent.check(true) }.to raise_exception Occi::Errors::KindNotDefinedError
|
300
303
|
end
|
304
|
+
|
305
|
+
it 'raises expection for nonexistent mixins' do
|
306
|
+
ent = Occi::Core::Entity.new(kind, [], defs)
|
307
|
+
ent.model = model
|
308
|
+
ent.mixins << undefmixin
|
309
|
+
expect{ ent.check }.to raise_exception Occi::Errors::CategoryNotDefinedError
|
310
|
+
end
|
301
311
|
end
|
302
312
|
end
|
303
313
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: occi-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Feldhaus
|
@@ -10,48 +10,48 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-02-
|
13
|
+
date: 2014-02-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - '>='
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: hashie
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - '>='
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - '>='
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: uuidtools
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: 2.1.3
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - '>='
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: 2.1.3
|
57
57
|
- !ruby/object:Gem::Dependency
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
name: settingslogic
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - '>='
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
type: :runtime
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - '>='
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
description: OCCI is a collection of classes to simplify the implementation of the
|
@@ -253,12 +253,12 @@ require_paths:
|
|
253
253
|
- lib
|
254
254
|
required_ruby_version: !ruby/object:Gem::Requirement
|
255
255
|
requirements:
|
256
|
-
- -
|
256
|
+
- - '>='
|
257
257
|
- !ruby/object:Gem::Version
|
258
258
|
version: 1.9.3
|
259
259
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
260
|
requirements:
|
261
|
-
- -
|
261
|
+
- - '>='
|
262
262
|
- !ruby/object:Gem::Version
|
263
263
|
version: '0'
|
264
264
|
requirements: []
|