treequel 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/Rakefile CHANGED
@@ -35,6 +35,7 @@ hoespec = Hoe.spec 'treequel' do
35
35
  " - termios",
36
36
  " - ruby-terminfo",
37
37
  " - columnize",
38
+ " - sysexits",
38
39
  '',
39
40
  "You can install those automatically if you use the --development flag when",
40
41
  "installing Treequel."
@@ -43,6 +44,7 @@ hoespec = Hoe.spec 'treequel' do
43
44
 
44
45
  self.require_ruby_version( '>=1.8.7' )
45
46
 
47
+ self.rspec_options += ['-cfd'] if self.respond_to?( :rspec_options= )
46
48
  self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= )
47
49
  self.manual_source_dir = 'src' if self.respond_to?( :manual_source_dir= )
48
50
  self.yard_opts = [ '--use-cache', '--protected', '--verbose' ] if
@@ -53,10 +53,10 @@ end
53
53
  module Treequel
54
54
 
55
55
  # Library version
56
- VERSION = '1.3.0'
56
+ VERSION = '1.3.1'
57
57
 
58
58
  # VCS revision
59
- REVISION = %q$Revision: 554028334395 $
59
+ REVISION = %q$Revision: fb7ec4e38f66 $
60
60
 
61
61
  # Common paths for ldap.conf
62
62
  COMMON_LDAP_CONF_PATHS = %w[
@@ -92,7 +92,7 @@ module Treequel::Model::ObjectClass
92
92
  rdn_pair.split( /\+/ ).each do |attrpair|
93
93
  k, v = attrpair.split( /\s*=\s*/ )
94
94
  entryhash[ k ] ||= []
95
- entryhash[ k ] << v
95
+ entryhash[ k ] << v unless entryhash[ k ].include?( v )
96
96
  end
97
97
 
98
98
  return self.model_class.new( directory, dn, entryhash )
@@ -185,7 +185,21 @@ describe Treequel::Model::ObjectClass do
185
185
  result = mixin.create( @directory, TEST_PERSON_DN )
186
186
  result.should be_a( Treequel::Model )
187
187
  result[:objectClass].should include( 'inetOrgPerson' )
188
- result[TEST_PERSON_DN_ATTR].should include( TEST_PERSON_DN_VALUE )
188
+ result[TEST_PERSON_DN_ATTR].should == [ TEST_PERSON_DN_VALUE ]
189
+ end
190
+
191
+ it "doesn't add the extracted DN attribute if it's already present in the entry" do
192
+ mixin = Module.new do
193
+ extend Treequel::Model::ObjectClass
194
+ model_objectclasses :inetOrgPerson
195
+ end
196
+
197
+ result = mixin.create( @directory, TEST_PERSON_DN,
198
+ TEST_PERSON_DN_ATTR => [TEST_PERSON_DN_VALUE] )
199
+ result.should be_a( Treequel::Model )
200
+ result[:objectClass].should include( 'inetOrgPerson' )
201
+ result[TEST_PERSON_DN_ATTR].should have( 1 ).member
202
+ result[TEST_PERSON_DN_ATTR].should == [ TEST_PERSON_DN_VALUE ]
189
203
  end
190
204
 
191
205
  it "merges objectClasses passed to the creation method" do
@@ -199,6 +213,7 @@ describe Treequel::Model::ObjectClass do
199
213
  result.should be_a( Treequel::Model )
200
214
  result[:objectClass].should have( 2 ).members
201
215
  result[:objectClass].should include( 'inetOrgPerson', 'person' )
216
+ result[TEST_PERSON_DN_ATTR].should have( 1 ).member
202
217
  result[TEST_PERSON_DN_ATTR].should include( TEST_PERSON_DN_VALUE )
203
218
  end
204
219
 
@@ -216,36 +231,6 @@ describe Treequel::Model::ObjectClass do
216
231
  result[TEST_HOST_MULTIVALUE_DN_ATTR2].should include( TEST_HOST_MULTIVALUE_DN_VALUE2 )
217
232
  end
218
233
 
219
- it "can instantiate a new model object with its declared objectClasses" do
220
- conn = mock( "ldap connection object" )
221
- directory = get_fixtured_directory( conn )
222
-
223
- mixin = Module.new do
224
- extend Treequel::Model::ObjectClass
225
- model_objectclasses :inetOrgPerson
226
- end
227
-
228
- result = mixin.create( directory, TEST_PERSON_DN )
229
- result.should be_a( Treequel::Model )
230
- result[:objectClass].should include( 'inetOrgPerson' )
231
- end
232
-
233
- it "merges objectClasses passed to the creation method" do
234
- conn = mock( "ldap connection object" )
235
- directory = get_fixtured_directory( conn )
236
-
237
- mixin = Module.new do
238
- extend Treequel::Model::ObjectClass
239
- model_objectclasses :inetOrgPerson
240
- end
241
-
242
- result = mixin.create( directory, TEST_PERSON_DN,
243
- :objectClass => [:person, :inetOrgPerson] )
244
- result.should be_a( Treequel::Model )
245
- result[:objectClass].should have( 2 ).members
246
- result[:objectClass].should include( 'inetOrgPerson', 'person' )
247
- end
248
-
249
234
  end
250
235
 
251
236
  context "module that has one required objectClass declared" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: treequel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 0
10
- version: 1.3.0
9
+ - 1
10
+ version: 1.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Granger
@@ -36,7 +36,7 @@ cert_chain:
36
36
  cmlhXe46pZNJgWKbxZah85jIjx95hR8vOI+NAM5iH9kOqK13DrxacTKPhqj5PjwF
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2011-01-13 00:00:00 -08:00
39
+ date: 2011-01-17 00:00:00 -08:00
40
40
  default_executable:
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
@@ -264,6 +264,7 @@ post_install_message: |-
264
264
  - termios
265
265
  - ruby-terminfo
266
266
  - columnize
267
+ - sysexits
267
268
 
268
269
  You can install those automatically if you use the --development flag when
269
270
  installing Treequel.
metadata.gz.sig CHANGED
Binary file