Permalink
Browse files

version 0.1.1

  • Loading branch information...
1 parent fc33114 commit 292fe3e1436c0d9a13a1d29e6326140e1e067a92 @jcredding jcredding committed Aug 29, 2011
Showing with 27 additions and 27 deletions.
  1. +4 −4 Gemfile.lock
  2. +2 −2 ad-ldap.gemspec
  3. +1 −1 lib/ad-ldap/version.rb
  4. +20 −20 test/unit/ad-ldap/search_args_test.rb
View
@@ -1,14 +1,14 @@
PATH
remote: .
specs:
- ad-ldap (0.1.0)
+ ad-ldap (0.1.1)
net-ldap (~> 0.2.2)
GEM
remote: http://rubygems.org/
specs:
ansi (1.3.0)
- assert (0.2.1)
+ assert (0.3.0)
ansi (~> 1.3)
mocha (0.9.12)
net-ldap (0.2.2)
@@ -19,6 +19,6 @@ PLATFORMS
DEPENDENCIES
ad-ldap!
- assert (~> 0.2.0)
- mocha (= 0.9.12)
+ assert (~> 0.3.0)
+ mocha (~> 0.9.12)
rake (~> 0.9.2)
View
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "net-ldap", "~>0.2.2"
- s.add_development_dependency "assert", "~>0.2.0"
- s.add_development_dependency "mocha", "=0.9.12"
+ s.add_development_dependency "assert", "~>0.3.0"
+ s.add_development_dependency "mocha", "~>0.9.12"
end
View
@@ -1,5 +1,5 @@
module AD
module LDAP
- VERSION = "0.1.0"
+ VERSION = "0.1.1"
end
end
@@ -1,23 +1,23 @@
require 'assert'
class AD::LDAP::SearchArgs
-
+
class BaseTest < Assert::Context
desc "the AD::LDAP::SearchArgs class"
setup do
AD::LDAP.config.treebase = @treebase = "DC=example, DC=com"
@search_args = AD::LDAP::SearchArgs.new({})
end
subject{ @search_args }
-
+
should "be a kind of Hash" do
assert_kind_of Hash, subject
end
should "set the base to the configured value for AD::LDAP" do
assert_equal @treebase, subject[:base]
end
end
-
+
class WithOnlyLDAPKeysTest < Assert::Context
desc "the AD::LDAP::SearchArgs initialized with only net-ldap keys"
setup do
@@ -28,14 +28,14 @@ class WithOnlyLDAPKeysTest < Assert::Context
@search_args = AD::LDAP::SearchArgs.new(@original)
end
subject{ @search_args }
-
+
should "not alter the hash passed to it" do
@original.each do |key, value|
assert_equal value, @search_args[key]
end
end
end
-
+
class WithNonLDAPKeysTest < Assert::Context
desc "the AD::LDAP::SearchArgs initialized with non net-ldap keys"
setup do
@@ -47,13 +47,13 @@ class WithNonLDAPKeysTest < Assert::Context
@search_args = AD::LDAP::SearchArgs.new(@original)
end
subject{ @search_args }
-
+
should "set the filter based off the non net-ldap keys" do
assert_equal @original[:base], subject[:base]
assert_equal @expected_filter.to_s, subject[:filter].to_s
end
end
-
+
class WithMappingsTest < Assert::Context
desc "search args with a mapping filter"
setup do
@@ -63,16 +63,16 @@ class WithMappingsTest < Assert::Context
@search_args = AD::LDAP::SearchArgs.new(@original)
end
subject{ @search_args }
-
+
should "use the mapping for the field" do
assert_equal @expected_filter.to_s, subject[:filter].to_s
end
-
+
teardown do
AD::LDAP.config.mappings = {}
end
end
-
+
class WithMultipleFiltersTest < Assert::Context
desc "search args with a multiple filters"
setup do
@@ -83,12 +83,12 @@ class WithMultipleFiltersTest < Assert::Context
@search_args = AD::LDAP::SearchArgs.new(@original)
end
subject{ @search_args }
-
+
should "join the filters together" do
assert_equal @expected_filter.to_s, subject[:filter].to_s
end
end
-
+
class WithEqualFilterTest < Assert::Context
desc "search args with a equal filter"
setup do
@@ -97,12 +97,12 @@ class WithEqualFilterTest < Assert::Context
@search_args = AD::LDAP::SearchArgs.new(@original)
end
subject{ @search_args }
-
+
should "create an equal filter for the field" do
assert_equal @expected_filter.to_s, subject[:filter].to_s
end
end
-
+
class WithNotEqualFilterTest < Assert::Context
desc "search args with a not equal filter"
setup do
@@ -111,12 +111,12 @@ class WithNotEqualFilterTest < Assert::Context
@search_args = AD::LDAP::SearchArgs.new(@original)
end
subject{ @search_args }
-
+
should "create a not equal filter for the field" do
assert_equal @expected_filter.to_s, subject[:filter].to_s
end
end
-
+
class WithGreaterThanOrEqualFilterTest < Assert::Context
desc "search args with a greater than or equal filter"
setup do
@@ -125,12 +125,12 @@ class WithGreaterThanOrEqualFilterTest < Assert::Context
@search_args = AD::LDAP::SearchArgs.new(@original)
end
subject{ @search_args }
-
+
should "create a greater than or equal filter for the field" do
assert_equal @expected_filter.to_s, subject[:filter].to_s
end
end
-
+
class WithLessThanOrEqualFilterTest < Assert::Context
desc "search args with a less than or equal filter"
setup do
@@ -139,10 +139,10 @@ class WithLessThanOrEqualFilterTest < Assert::Context
@search_args = AD::LDAP::SearchArgs.new(@original)
end
subject{ @search_args }
-
+
should "create a less than or equal filter for the field" do
assert_equal @expected_filter.to_s, subject[:filter].to_s
end
end
-
+
end

0 comments on commit 292fe3e

Please sign in to comment.