cornell_ldap 1.0.0 → 1.1.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
data/cornell_ldap.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cornell_ldap}
8
- s.version = "1.0.0"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ari Epstein"]
data/lib/cornell_ldap.rb CHANGED
@@ -40,7 +40,7 @@ module CornellLdap
40
40
 
41
41
  # Returns has representation of on campus address for person if one is
42
42
  # reported.
43
- # See CornellLdap::Record#make_address_attributes for more information.
43
+ # See CornellLdap::Record#address_attributes for more information.
44
44
  def campus_address
45
45
  unless @campus_address.nil?
46
46
  return @campus_address
@@ -52,24 +52,24 @@ module CornellLdap
52
52
  end
53
53
 
54
54
  # Returns local area (Ithaca area) address for person if one is reported
55
- # See CornellLdap::Record#make_address_attributes for more information.
55
+ # See CornellLdap::Record#address_attributes for more information.
56
56
  def local_address
57
57
  unless @local_address.nil?
58
58
  return @local_address
59
59
  end
60
60
  @local_address = false unless attribute_present?('cornelledulocaladdress') &&
61
- @local_address = Record.make_address_attributes(cornelledulocaladdress)
61
+ @local_address = Record.address_attributes(cornelledulocaladdress)
62
62
  return local_address
63
63
  end
64
64
 
65
65
  # Returns home address for person if one is reported
66
- # See CornellLdap::Record#make_address_attributes for more information.
66
+ # See CornellLdap::Record#address_attributes for more information.
67
67
  def home_address
68
68
  unless @home_address.nil?
69
69
  return @home_address
70
70
  end
71
71
  @home_address = false unless attribute_present?('homePostalAddress') &&
72
- @home_address = Record.make_address_attributes(homePostalAddress)
72
+ @home_address = Record.address_attributes(homePostalAddress)
73
73
  return home_address
74
74
  end
75
75
 
@@ -59,6 +59,18 @@ describe "CornellLdap" do
59
59
  end
60
60
  end
61
61
 
62
+ it "should call address_attributes to return local address" do
63
+ person = mock_person
64
+ CornellLdap::Record.should_receive(:address_attributes).once.with(person.cornelledulocaladdress)
65
+ person.local_address
66
+ end
67
+
68
+ it "should call address_attributes to return home address" do
69
+ person = mock_person
70
+ CornellLdap::Record.should_receive(:address_attributes).once.with(person.homePostalAddress)
71
+ person.home_address
72
+ end
73
+
62
74
  def mock_person
63
75
  person = CornellLdap::Record.new
64
76
  person.attributes={
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cornell_ldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ari Epstein