activeldap 0.10.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/CHANGES +6 -30
  2. data/README +4 -2
  3. data/Rakefile +7 -0
  4. data/data/locale/en/LC_MESSAGES/active-ldap.mo +0 -0
  5. data/data/locale/ja/LC_MESSAGES/active-ldap.mo +0 -0
  6. data/examples/al-admin/po/en/al-admin.po +3 -3
  7. data/examples/al-admin/po/ja/al-admin.po +3 -3
  8. data/examples/al-admin/po/nl/al-admin.po +3 -3
  9. data/lib/active_ldap/adapter/base.rb +0 -2
  10. data/lib/active_ldap/base.rb +4 -2
  11. data/lib/active_ldap/get_text_support.rb +3 -11
  12. data/lib/active_ldap/operations.rb +1 -0
  13. data/lib/active_ldap/schema/syntaxes.rb +5 -3
  14. data/lib/active_ldap/validations.rb +25 -15
  15. data/lib/active_ldap.rb +1 -1
  16. data/po/en/active-ldap.po +1 -1
  17. data/po/ja/active-ldap.po +1 -1
  18. data/rails/plugin/active_ldap/init.rb +1 -1
  19. data/test/run-test.rb +2 -0
  20. data/test/test_base.rb +63 -1
  21. data/test/test_syntax.rb +3 -2
  22. data/test-unit-ext/NEWS.en +28 -0
  23. data/test-unit-ext/NEWS.ja +28 -0
  24. data/test-unit-ext/README.en +247 -0
  25. data/test-unit-ext/README.ja +246 -0
  26. data/test-unit-ext/Rakefile +111 -0
  27. data/{test → test-unit-ext/lib}/test-unit-ext/always-show-result.rb +0 -0
  28. data/test-unit-ext/lib/test-unit-ext/assertions.rb +40 -0
  29. data/test-unit-ext/lib/test-unit-ext/attributes.rb +129 -0
  30. data/{test → test-unit-ext/lib}/test-unit-ext/backtrace-filter.rb +0 -0
  31. data/test-unit-ext/lib/test-unit-ext/color.rb +59 -0
  32. data/test-unit-ext/lib/test-unit-ext/colorized-runner.rb +111 -0
  33. data/test-unit-ext/lib/test-unit-ext/diff.rb +516 -0
  34. data/{test → test-unit-ext/lib}/test-unit-ext/long-display-for-emacs.rb +0 -0
  35. data/test-unit-ext/lib/test-unit-ext/notification.rb +79 -0
  36. data/test-unit-ext/lib/test-unit-ext/omission.rb +96 -0
  37. data/test-unit-ext/lib/test-unit-ext/pending.rb +97 -0
  38. data/{test → test-unit-ext/lib}/test-unit-ext/priority.rb +25 -53
  39. data/test-unit-ext/lib/test-unit-ext/version.rb +3 -0
  40. data/test-unit-ext/lib/test-unit-ext/xml-report.rb +224 -0
  41. data/test-unit-ext/lib/test-unit-ext.rb +16 -0
  42. data/test-unit-ext/misc/rd2html.rb +42 -0
  43. data/test-unit-ext/test/run-test.rb +14 -0
  44. data/test-unit-ext/test/test_attributes.rb +139 -0
  45. data/test-unit-ext/test/test_color.rb +39 -0
  46. data/test-unit-ext/test/test_diff.rb +475 -0
  47. data/test-unit-ext/test/test_notification.rb +32 -0
  48. data/test-unit-ext/test/test_omission.rb +64 -0
  49. data/test-unit-ext/test/test_pending.rb +64 -0
  50. data/test-unit-ext/test/test_priority.rb +88 -0
  51. data/test-unit-ext/test/test_xml_report.rb +161 -0
  52. metadata +34 -7
  53. data/test/test-unit-ext.rb +0 -4
@@ -0,0 +1,88 @@
1
+ require 'test-unit-ext'
2
+
3
+ class TestPriority < Test::Unit::TestCase
4
+ class TestCase < Test::Unit::TestCase
5
+ class << self
6
+ def suite
7
+ Test::Unit::TestSuite.new(name)
8
+ end
9
+ end
10
+
11
+ priority :must
12
+ def test_must
13
+ assert(true)
14
+ end
15
+
16
+ def test_must_inherited
17
+ assert(true)
18
+ end
19
+
20
+ priority :important
21
+ def test_important
22
+ assert(true)
23
+ end
24
+
25
+ def test_important_inherited
26
+ assert(true)
27
+ end
28
+
29
+ priority :high
30
+ def test_high
31
+ assert(true)
32
+ end
33
+
34
+ def test_high_inherited
35
+ assert(true)
36
+ end
37
+
38
+ priority :normal
39
+ def test_normal
40
+ assert(true)
41
+ end
42
+
43
+ def test_normal_inherited
44
+ assert(true)
45
+ end
46
+
47
+ priority :low
48
+ def test_low
49
+ assert(true)
50
+ end
51
+
52
+ def test_low_inherited
53
+ assert(true)
54
+ end
55
+
56
+ priority :never
57
+ def test_never
58
+ assert(true)
59
+ end
60
+
61
+ def test_never_inherited
62
+ assert(true)
63
+ end
64
+ end
65
+
66
+ def test_priority
67
+ assert_priority("must", 1.0, 0.0001)
68
+ assert_priority("important", 0.9, 0.09)
69
+ assert_priority("high", 0.70, 0.1)
70
+ assert_priority("normal", 0.5, 0.1)
71
+ assert_priority("low", 0.25, 0.1)
72
+ assert_priority("never", 0.0, 0.0001)
73
+ end
74
+
75
+ def assert_priority(priority, expected, delta)
76
+ assert_need_to_run("test_#{priority}", expected, delta)
77
+ assert_need_to_run("test_#{priority}_inherited", expected, delta)
78
+ end
79
+
80
+ def assert_need_to_run(test_name, expected, delta)
81
+ n = 1000
82
+ n_need_to_run = 0
83
+ n.times do |i|
84
+ n_need_to_run +=1 if TestCase.need_to_run?(test_name)
85
+ end
86
+ assert_in_delta(expected, n_need_to_run.to_f / n, delta)
87
+ end
88
+ end
@@ -0,0 +1,161 @@
1
+ require 'test-unit-ext'
2
+
3
+ class TestXMLReport < Test::Unit::TestCase
4
+ class TestCase < Test::Unit::TestCase
5
+ def default_test
6
+ end
7
+
8
+ def _test_success
9
+ assert(true)
10
+ end
11
+
12
+ TEST_FAILURE_LINE = __LINE__ + 3
13
+ bug 1234
14
+ def _test_failure
15
+ assert(false)
16
+ end
17
+
18
+ TEST_ERROR_LINE = __LINE__ + 2
19
+ def _test_error
20
+ non_existence_method()
21
+ end
22
+
23
+ def inspect
24
+ "TEST-CASE"
25
+ end
26
+ end
27
+
28
+ include ERB::Util
29
+
30
+ def test_empty_test
31
+ assert_xml("<report/>", suite)
32
+ end
33
+
34
+ def test_success_result
35
+ elapsed = "0.001"
36
+ assert_xml(<<-XML, suite([TestCase.new("_test_success")]), elapsed)
37
+ <report>
38
+ <result>
39
+ <test_case>
40
+ <name>TestXMLReport::TestCase</name>
41
+ <description/>
42
+ </test_case>
43
+ <test>
44
+ <name>_test_success</name>
45
+ <description/>
46
+ </test>
47
+ <status>success</status>
48
+ <detail></detail>
49
+ <elapsed>#{elapsed}</elapsed>
50
+ </result>
51
+ </report>
52
+ XML
53
+ end
54
+
55
+ def test_failure_result
56
+ elapsed = "0.001"
57
+ backtrace_line = __LINE__ + 1
58
+ assert_xml(<<-XML, suite([TestCase.new("_test_failure")]), elapsed)
59
+ <report>
60
+ <result>
61
+ <test_case>
62
+ <name>TestXMLReport::TestCase</name>
63
+ <description/>
64
+ </test_case>
65
+ <test>
66
+ <name>_test_failure</name>
67
+ <description/>
68
+ <option>
69
+ <name>bug</name>
70
+ <value>1234</value>
71
+ </option>
72
+ </test>
73
+ <status>failure</status>
74
+ <detail>&lt;false&gt; is not true.</detail>
75
+ <elapsed>#{elapsed}</elapsed>
76
+ <backtrace>
77
+ <entry>
78
+ <file>#{__FILE__}</file>
79
+ <line>#{TestCase::TEST_FAILURE_LINE}</line>
80
+ <info>in `_test_failure'</info>
81
+ </entry>
82
+ <entry>
83
+ <file>#{__FILE__}</file>
84
+ <line>#{TEST_RUN_LINE}</line>
85
+ <info>in `assert_xml'</info>
86
+ </entry>
87
+ <entry>
88
+ <file>#{__FILE__}</file>
89
+ <line>#{backtrace_line}</line>
90
+ <info>in `test_failure_result'</info>
91
+ </entry>
92
+ </backtrace>
93
+ </result>
94
+ </report>
95
+ XML
96
+ end
97
+
98
+ def test_error_result
99
+ test = TestCase.new("_test_error")
100
+ detail = "NoMethodError: undefined method `non_existence_method' " +
101
+ "for TEST-CASE:#{test.class.name}"
102
+ elapsed = "0.001"
103
+ backtrace_line = __LINE__ + 1
104
+ assert_xml(<<-XML, suite([test]), elapsed)
105
+ <report>
106
+ <result>
107
+ <test_case>
108
+ <name>TestXMLReport::TestCase</name>
109
+ <description/>
110
+ </test_case>
111
+ <test>
112
+ <name>_test_error</name>
113
+ <description/>
114
+ </test>
115
+ <status>error</status>
116
+ <detail>#{h(detail)}</detail>
117
+ <elapsed>#{elapsed}</elapsed>
118
+ <backtrace>
119
+ <entry>
120
+ <file>#{__FILE__}</file>
121
+ <line>#{TestCase::TEST_ERROR_LINE}</line>
122
+ <info>in `_test_error'</info>
123
+ </entry>
124
+ <entry>
125
+ <file>#{__FILE__}</file>
126
+ <line>#{TEST_RUN_LINE}</line>
127
+ <info>in `assert_xml'</info>
128
+ </entry>
129
+ <entry>
130
+ <file>#{__FILE__}</file>
131
+ <line>#{backtrace_line}</line>
132
+ <info>in `test_error_result'</info>
133
+ </entry>
134
+ </backtrace>
135
+ </result>
136
+ </report>
137
+ XML
138
+ end
139
+
140
+ private
141
+ def suite(tests=[], name="Unnamed TestSuite")
142
+ test_suite = Test::Unit::TestSuite.new(name)
143
+ tests.each do |test|
144
+ test_suite << test
145
+ end
146
+ test_suite
147
+ end
148
+
149
+ TEST_RUN_LINE = __LINE__ + 2
150
+ def assert_xml(expected, suite, normalized_elapsed=nil)
151
+ result = Test::Unit::UI::Console::TestRunner.run(suite,
152
+ Test::Unit::UI::SILENT)
153
+ xml = result.to_xml
154
+ if xml and normalized_elapsed
155
+ xml = xml.gsub(/<elapsed>[\d.]+<\/elapsed>/) do
156
+ "<elapsed>#{normalized_elapsed}</elapsed>"
157
+ end
158
+ end
159
+ assert_equal(expected, xml)
160
+ end
161
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: activeldap
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.10.0
7
- date: 2008-03-01 00:00:00 -08:00
6
+ version: 1.0.0
7
+ date: 2008-05-26 00:00:00 -07:00
8
8
  summary: Ruby/ActiveLdap is a object-oriented API to LDAP
9
9
  require_paths:
10
10
  - lib
@@ -40,6 +40,8 @@ files:
40
40
  - TODO
41
41
  - benchmark/bench-al.rb
42
42
  - benchmark/config.yaml.sample
43
+ - data/locale/en/LC_MESSAGES/active-ldap.mo
44
+ - data/locale/ja/LC_MESSAGES/active-ldap.mo
43
45
  - examples/al-admin/README
44
46
  - examples/al-admin/Rakefile
45
47
  - examples/al-admin/app/controllers/account_controller.rb
@@ -425,15 +427,40 @@ files:
425
427
  - rails/plugin/active_ldap/generators/scaffold_active_ldap/scaffold_active_ldap_generator.rb
426
428
  - rails/plugin/active_ldap/generators/scaffold_al/scaffold_al_generator.rb
427
429
  - rails/plugin/active_ldap/init.rb
430
+ - test-unit-ext/NEWS.en
431
+ - test-unit-ext/NEWS.ja
432
+ - test-unit-ext/README.en
433
+ - test-unit-ext/README.ja
434
+ - test-unit-ext/Rakefile
435
+ - test-unit-ext/lib/test-unit-ext.rb
436
+ - test-unit-ext/lib/test-unit-ext/always-show-result.rb
437
+ - test-unit-ext/lib/test-unit-ext/assertions.rb
438
+ - test-unit-ext/lib/test-unit-ext/attributes.rb
439
+ - test-unit-ext/lib/test-unit-ext/backtrace-filter.rb
440
+ - test-unit-ext/lib/test-unit-ext/color.rb
441
+ - test-unit-ext/lib/test-unit-ext/colorized-runner.rb
442
+ - test-unit-ext/lib/test-unit-ext/diff.rb
443
+ - test-unit-ext/lib/test-unit-ext/long-display-for-emacs.rb
444
+ - test-unit-ext/lib/test-unit-ext/notification.rb
445
+ - test-unit-ext/lib/test-unit-ext/omission.rb
446
+ - test-unit-ext/lib/test-unit-ext/pending.rb
447
+ - test-unit-ext/lib/test-unit-ext/priority.rb
448
+ - test-unit-ext/lib/test-unit-ext/version.rb
449
+ - test-unit-ext/lib/test-unit-ext/xml-report.rb
450
+ - test-unit-ext/misc/rd2html.rb
451
+ - test-unit-ext/test/run-test.rb
452
+ - test-unit-ext/test/test_attributes.rb
453
+ - test-unit-ext/test/test_color.rb
454
+ - test-unit-ext/test/test_diff.rb
455
+ - test-unit-ext/test/test_notification.rb
456
+ - test-unit-ext/test/test_omission.rb
457
+ - test-unit-ext/test/test_pending.rb
458
+ - test-unit-ext/test/test_priority.rb
459
+ - test-unit-ext/test/test_xml_report.rb
428
460
  - test/al-test-utils.rb
429
461
  - test/command.rb
430
462
  - test/config.yaml.sample
431
463
  - test/run-test.rb
432
- - test/test-unit-ext.rb
433
- - test/test-unit-ext/always-show-result.rb
434
- - test/test-unit-ext/backtrace-filter.rb
435
- - test/test-unit-ext/long-display-for-emacs.rb
436
- - test/test-unit-ext/priority.rb
437
464
  - test/test_acts_as_tree.rb
438
465
  - test/test_adapter.rb
439
466
  - test/test_associations.rb
@@ -1,4 +0,0 @@
1
- require "test-unit-ext/always-show-result"
2
- require "test-unit-ext/priority"
3
- require "test-unit-ext/backtrace-filter"
4
- require "test-unit-ext/long-display-for-emacs"