activesambaldap 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/NEWS.en +20 -18
  2. data/NEWS.ja +23 -21
  3. data/README.en +122 -95
  4. data/README.ja +125 -98
  5. data/Rakefile +29 -64
  6. data/bin/asl-groupadd +1 -1
  7. data/bin/asl-groupadd.help +1 -0
  8. data/bin/asl-groupdel +1 -1
  9. data/bin/asl-groupdel.help +1 -0
  10. data/bin/asl-groupmod +1 -1
  11. data/bin/asl-groupmod.help +1 -0
  12. data/bin/asl-groupshow +1 -1
  13. data/bin/asl-groupshow.help +1 -0
  14. data/bin/asl-passwd +1 -1
  15. data/bin/asl-passwd.help +1 -0
  16. data/bin/asl-populate +2 -2
  17. data/bin/asl-populate.help +1 -0
  18. data/bin/asl-purge +1 -1
  19. data/bin/asl-purge.help +1 -0
  20. data/bin/asl-samba-computeradd +1 -1
  21. data/bin/asl-samba-computeradd.help +1 -0
  22. data/bin/asl-samba-groupadd +1 -1
  23. data/bin/asl-samba-groupadd.help +1 -0
  24. data/bin/asl-samba-groupdel +1 -1
  25. data/bin/asl-samba-groupdel.help +1 -0
  26. data/bin/asl-samba-groupmod +1 -1
  27. data/bin/asl-samba-groupmod.help +1 -0
  28. data/bin/asl-samba-useradd +1 -1
  29. data/bin/asl-samba-useradd.help +1 -0
  30. data/bin/asl-samba-userdel +1 -1
  31. data/bin/asl-samba-userdel.help +1 -0
  32. data/bin/asl-samba-usermod +1 -1
  33. data/bin/asl-samba-usermod.help +1 -0
  34. data/bin/asl-useradd +1 -1
  35. data/bin/asl-useradd.help +6 -4
  36. data/bin/asl-userdel +1 -1
  37. data/bin/asl-userdel.help +1 -0
  38. data/bin/asl-usermod +1 -1
  39. data/bin/asl-usermod.help +2 -0
  40. data/bin/asl-usershow +1 -1
  41. data/bin/asl-usershow.help +1 -0
  42. data/data/locale/ja/LC_MESSAGES/active-samba-ldap.mo +0 -0
  43. data/lib/active_samba_ldap/version.rb +1 -1
  44. data/lib/active_samba_ldap.rb +1 -1
  45. data/po/ja/active-samba-ldap.po +5 -5
  46. data/rails/{plugin/active_samba_ldap/README → README} +0 -0
  47. data/rails/{plugin/active_samba_ldap/init.rb → init.rb} +1 -1
  48. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb +0 -0
  49. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/computer.rb +0 -0
  50. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/dc.rb +0 -0
  51. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/group.rb +0 -0
  52. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/idmap.rb +0 -0
  53. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/ldap.yml +0 -0
  54. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/ou.rb +0 -0
  55. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/samba_controller.rb +0 -0
  56. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/samba_helper.rb +0 -0
  57. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/samba_index.rhtml +0 -0
  58. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/samba_populate.rhtml +0 -0
  59. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/samba_purge.rhtml +0 -0
  60. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/unix_id_pool.rb +0 -0
  61. data/{rails/plugin/active_samba_ldap/generators → rails_generators}/scaffold_active_samba_ldap/templates/user.rb +0 -0
  62. data/test/asl-test-utils.rb +2 -2
  63. data/test/test_asl_usershow.rb +2 -2
  64. data/test/test_password.rb +2 -2
  65. data/test/test_user_home_directory.rb +2 -2
  66. data/test-unit/History.txt +76 -1
  67. data/test-unit/README.txt +32 -12
  68. data/test-unit/Rakefile +19 -1
  69. data/test-unit/TODO +5 -0
  70. data/test-unit/lib/test/unit/assertions.rb +515 -88
  71. data/test-unit/lib/test/unit/autorunner.rb +93 -14
  72. data/test-unit/lib/test/unit/collector/load.rb +1 -1
  73. data/test-unit/lib/test/unit/collector.rb +1 -1
  74. data/test-unit/lib/test/unit/color-scheme.rb +86 -0
  75. data/test-unit/lib/test/unit/color.rb +40 -5
  76. data/test-unit/lib/test/unit/diff.rb +14 -0
  77. data/test-unit/lib/test/unit/fixture.rb +7 -16
  78. data/test-unit/lib/test/unit/notification.rb +9 -0
  79. data/test-unit/lib/test/unit/omission.rb +14 -0
  80. data/test-unit/lib/test/unit/pending.rb +16 -0
  81. data/test-unit/lib/test/unit/priority.rb +38 -3
  82. data/test-unit/lib/test/unit/runner/console.rb +8 -2
  83. data/test-unit/lib/test/unit/testcase.rb +263 -12
  84. data/test-unit/lib/test/unit/ui/console/testrunner.rb +58 -30
  85. data/test-unit/lib/test/unit/util/method-owner-finder.rb +28 -0
  86. data/test-unit/lib/test/unit/version.rb +1 -1
  87. data/test-unit/lib/test/unit.rb +62 -0
  88. data/test-unit/sample/test_user.rb +22 -0
  89. data/test-unit/test/collector/{test_descendant.rb → test-descendant.rb} +0 -0
  90. data/test-unit/test/collector/{test_load.rb → test-load.rb} +1 -1
  91. data/test-unit/test/{test_attribute.rb → test-attribute.rb} +0 -0
  92. data/test-unit/test/test-color-scheme.rb +56 -0
  93. data/test-unit/test/{test_color.rb → test-color.rb} +10 -0
  94. data/test-unit/test/{test_diff.rb → test-diff.rb} +0 -0
  95. data/test-unit/test/{test_emacs_runner.rb → test-emacs-runner.rb} +0 -0
  96. data/test-unit/test/test-fixture.rb +287 -0
  97. data/test-unit/test/{test_notification.rb → test-notification.rb} +4 -4
  98. data/test-unit/test/{test_omission.rb → test-omission.rb} +6 -6
  99. data/test-unit/test/{test_pending.rb → test-pending.rb} +12 -6
  100. data/test-unit/test/{test_priority.rb → test-priority.rb} +30 -0
  101. data/test-unit/test/{test_testcase.rb → test-testcase.rb} +100 -4
  102. data/test-unit/test/test_assertions.rb +462 -73
  103. data/test-unit/test/{testunit_test_util.rb → testunit-test-util.rb} +4 -2
  104. data/test-unit/test/ui/test_testrunmediator.rb +1 -1
  105. data/test-unit/test/util/test-method-owner-finder.rb +38 -0
  106. metadata +69 -79
  107. data/test-unit/test/test_fixture.rb +0 -275
@@ -0,0 +1,38 @@
1
+ require 'test/unit'
2
+
3
+ require 'test/unit/util/method-owner-finder'
4
+
5
+ class TestUnitMethodOwnerFinder < Test::Unit::TestCase
6
+ def test_find
7
+ assert_equal(Exception, find(RuntimeError.new, :inspect))
8
+ assert_equal(Exception, find(Exception.new, :inspect))
9
+
10
+ anonymous_class = Class.new do
11
+ end
12
+ assert_equal(Kernel, find(anonymous_class.new, :inspect))
13
+
14
+ anonymous_parent_class = Class.new do
15
+ def inspect
16
+ super + " by anonymous parent class"
17
+ end
18
+ end
19
+ anonymous_sub_class = Class.new(anonymous_parent_class) do
20
+ end
21
+ assert_equal(anonymous_parent_class, find(anonymous_sub_class.new, :inspect))
22
+
23
+ anonymous_module = Module.new do
24
+ def inspect
25
+ super + " by anonymous module"
26
+ end
27
+ end
28
+ anonymous_include_class = Class.new do
29
+ include anonymous_module
30
+ end
31
+ assert_equal(anonymous_module, find(anonymous_include_class.new, :inspect))
32
+ end
33
+
34
+ private
35
+ def find(object, method_name)
36
+ Test::Unit::Util::MethodOwnerFinder.find(object, method_name)
37
+ end
38
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesambaldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -9,29 +9,36 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-06-18 00:00:00 +09:00
12
+ date: 2009-07-18 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activeldap
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
20
21
  - - ">="
21
22
  - !ruby/object:Gem::Version
22
- version: 1.0.1
23
+ version: 1.1.0
23
24
  version:
24
25
  - !ruby/object:Gem::Dependency
25
26
  name: hoe
27
+ type: :development
26
28
  version_requirement:
27
29
  version_requirements: !ruby/object:Gem::Requirement
28
30
  requirements:
29
31
  - - ">="
30
32
  - !ruby/object:Gem::Version
31
- version: 1.5.3
33
+ version: 2.3.2
32
34
  version:
33
- description: ActiveSambaLdap provides object-oriented API to manipulate LDAP entry for Samba. ActiveSambaLdap also provides command-line tools to replace smbldap-tools written by Perl.
34
- email: kou@cozmixng.org
35
+ description: |
36
+ ActiveSambaLdap provides object-oriented API to manipulate
37
+ LDAP entry for Samba. ActiveSambaLdap also provides
38
+ command-line tools to replace smbldap-tools written by Perl.
39
+
40
+ email:
41
+ - kou@clear-code.com
35
42
  executables:
36
43
  - asl-groupadd
37
44
  - asl-groupdel
@@ -54,34 +61,6 @@ executables:
54
61
  extensions: []
55
62
 
56
63
  extra_rdoc_files:
57
- - NEWS.en
58
- - NEWS.ja
59
- - README.en
60
- - README.ja
61
- - lib/active_samba_ldap.rb
62
- - lib/active_samba_ldap/account_entry.rb
63
- - lib/active_samba_ldap/base.rb
64
- - lib/active_samba_ldap/command.rb
65
- - lib/active_samba_ldap/computer.rb
66
- - lib/active_samba_ldap/computer_account_entry.rb
67
- - lib/active_samba_ldap/configuration.rb
68
- - lib/active_samba_ldap/dc.rb
69
- - lib/active_samba_ldap/entry.rb
70
- - lib/active_samba_ldap/get_text_support.rb
71
- - lib/active_samba_ldap/group.rb
72
- - lib/active_samba_ldap/group_entry.rb
73
- - lib/active_samba_ldap/idmap.rb
74
- - lib/active_samba_ldap/ou.rb
75
- - lib/active_samba_ldap/populate.rb
76
- - lib/active_samba_ldap/reloadable.rb
77
- - lib/active_samba_ldap/samba_account_entry.rb
78
- - lib/active_samba_ldap/samba_entry.rb
79
- - lib/active_samba_ldap/samba_group_entry.rb
80
- - lib/active_samba_ldap/unix_id_pool.rb
81
- - lib/active_samba_ldap/user.rb
82
- - lib/active_samba_ldap/user_account_entry.rb
83
- - lib/active_samba_ldap/version.rb
84
- - lib/samba/encrypt.rb
85
64
  - bin/asl-groupadd.help
86
65
  - bin/asl-groupdel.help
87
66
  - bin/asl-groupmod.help
@@ -100,6 +79,10 @@ extra_rdoc_files:
100
79
  - bin/asl-userdel.help
101
80
  - bin/asl-usermod.help
102
81
  - bin/asl-usershow.help
82
+ - NEWS.en
83
+ - NEWS.ja
84
+ - README.en
85
+ - README.ja
103
86
  files:
104
87
  - NEWS.en
105
88
  - NEWS.ja
@@ -151,26 +134,27 @@ files:
151
134
  - lib/samba/encrypt.rb
152
135
  - misc/rd2html.rb
153
136
  - po/ja/active-samba-ldap.po
154
- - rails/plugin/active_samba_ldap/README
155
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb
156
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/computer.rb
157
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/dc.rb
158
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/group.rb
159
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/idmap.rb
160
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/ldap.yml
161
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/ou.rb
162
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_controller.rb
163
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_helper.rb
164
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_index.rhtml
165
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_populate.rhtml
166
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/samba_purge.rhtml
167
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/unix_id_pool.rb
168
- - rails/plugin/active_samba_ldap/generators/scaffold_active_samba_ldap/templates/user.rb
169
- - rails/plugin/active_samba_ldap/init.rb
137
+ - rails/README
138
+ - rails/init.rb
139
+ - rails_generators/scaffold_active_samba_ldap/scaffold_active_samba_ldap_generator.rb
140
+ - rails_generators/scaffold_active_samba_ldap/templates/computer.rb
141
+ - rails_generators/scaffold_active_samba_ldap/templates/dc.rb
142
+ - rails_generators/scaffold_active_samba_ldap/templates/group.rb
143
+ - rails_generators/scaffold_active_samba_ldap/templates/idmap.rb
144
+ - rails_generators/scaffold_active_samba_ldap/templates/ldap.yml
145
+ - rails_generators/scaffold_active_samba_ldap/templates/ou.rb
146
+ - rails_generators/scaffold_active_samba_ldap/templates/samba_controller.rb
147
+ - rails_generators/scaffold_active_samba_ldap/templates/samba_helper.rb
148
+ - rails_generators/scaffold_active_samba_ldap/templates/samba_index.rhtml
149
+ - rails_generators/scaffold_active_samba_ldap/templates/samba_populate.rhtml
150
+ - rails_generators/scaffold_active_samba_ldap/templates/samba_purge.rhtml
151
+ - rails_generators/scaffold_active_samba_ldap/templates/unix_id_pool.rb
152
+ - rails_generators/scaffold_active_samba_ldap/templates/user.rb
170
153
  - setup.rb
171
154
  - test-unit/History.txt
172
155
  - test-unit/README.txt
173
156
  - test-unit/Rakefile
157
+ - test-unit/TODO
174
158
  - test-unit/bin/testrb
175
159
  - test-unit/lib/test/unit.rb
176
160
  - test-unit/lib/test/unit/assertionfailederror.rb
@@ -182,6 +166,7 @@ files:
182
166
  - test-unit/lib/test/unit/collector/dir.rb
183
167
  - test-unit/lib/test/unit/collector/load.rb
184
168
  - test-unit/lib/test/unit/collector/objectspace.rb
169
+ - test-unit/lib/test/unit/color-scheme.rb
185
170
  - test-unit/lib/test/unit/color.rb
186
171
  - test-unit/lib/test/unit/diff.rb
187
172
  - test-unit/lib/test/unit/error.rb
@@ -204,6 +189,7 @@ files:
204
189
  - test-unit/lib/test/unit/ui/testrunnermediator.rb
205
190
  - test-unit/lib/test/unit/ui/testrunnerutilities.rb
206
191
  - test-unit/lib/test/unit/util/backtracefilter.rb
192
+ - test-unit/lib/test/unit/util/method-owner-finder.rb
207
193
  - test-unit/lib/test/unit/util/observable.rb
208
194
  - test-unit/lib/test/unit/util/procwrapper.rb
209
195
  - test-unit/lib/test/unit/version.rb
@@ -211,29 +197,32 @@ files:
211
197
  - test-unit/sample/subtracter.rb
212
198
  - test-unit/sample/tc_adder.rb
213
199
  - test-unit/sample/tc_subtracter.rb
200
+ - test-unit/sample/test_user.rb
214
201
  - test-unit/sample/ts_examples.rb
215
- - test-unit/test/collector/test_descendant.rb
202
+ - test-unit/test/collector/test-descendant.rb
203
+ - test-unit/test/collector/test-load.rb
216
204
  - test-unit/test/collector/test_dir.rb
217
- - test-unit/test/collector/test_load.rb
218
205
  - test-unit/test/collector/test_objectspace.rb
219
206
  - test-unit/test/run-test.rb
207
+ - test-unit/test/test-attribute.rb
208
+ - test-unit/test/test-color-scheme.rb
209
+ - test-unit/test/test-color.rb
210
+ - test-unit/test/test-diff.rb
211
+ - test-unit/test/test-emacs-runner.rb
212
+ - test-unit/test/test-fixture.rb
213
+ - test-unit/test/test-notification.rb
214
+ - test-unit/test/test-omission.rb
215
+ - test-unit/test/test-pending.rb
216
+ - test-unit/test/test-priority.rb
217
+ - test-unit/test/test-testcase.rb
220
218
  - test-unit/test/test_assertions.rb
221
- - test-unit/test/test_attribute.rb
222
- - test-unit/test/test_color.rb
223
- - test-unit/test/test_diff.rb
224
- - test-unit/test/test_emacs_runner.rb
225
219
  - test-unit/test/test_error.rb
226
220
  - test-unit/test/test_failure.rb
227
- - test-unit/test/test_fixture.rb
228
- - test-unit/test/test_notification.rb
229
- - test-unit/test/test_omission.rb
230
- - test-unit/test/test_pending.rb
231
- - test-unit/test/test_priority.rb
232
- - test-unit/test/test_testcase.rb
233
221
  - test-unit/test/test_testresult.rb
234
222
  - test-unit/test/test_testsuite.rb
235
- - test-unit/test/testunit_test_util.rb
223
+ - test-unit/test/testunit-test-util.rb
236
224
  - test-unit/test/ui/test_testrunmediator.rb
225
+ - test-unit/test/util/test-method-owner-finder.rb
237
226
  - test-unit/test/util/test_backtracefilter.rb
238
227
  - test-unit/test/util/test_observable.rb
239
228
  - test-unit/test/util/test_procwrapper.rb
@@ -277,14 +266,15 @@ files:
277
266
  - bin/asl-usershow.help
278
267
  has_rdoc: true
279
268
  homepage: http://asl.rubyforge.org/
269
+ licenses: []
270
+
280
271
  post_install_message:
281
272
  rdoc_options:
282
- - -t asl's activesambaldap-0.0.6 Documentation
273
+ - --title
274
+ - asl's activesambaldap-0.0.7 Documentation
283
275
  - --charset=UTF-8
284
276
  - --main
285
277
  - README.en
286
- - -T
287
- - kilmer
288
278
  require_paths:
289
279
  - lib
290
280
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -302,24 +292,24 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
292
  requirements: []
303
293
 
304
294
  rubyforge_project: asl
305
- rubygems_version: 1.1.1
295
+ rubygems_version: 1.3.4
306
296
  signing_key:
307
- specification_version: 2
297
+ specification_version: 3
308
298
  summary: ActiveSambaLdap is a library and a management tool for Samba + LDAP environment.
309
299
  test_files:
310
- - test/test_samba_encrypt.rb
300
+ - test/test_asl_groupdel.rb
311
301
  - test/test_group.rb
312
- - test/test_asl_usermod.rb
313
- - test/test_asl_usershow.rb
302
+ - test/test_password.rb
314
303
  - test/test_asl_passwd.rb
315
- - test/test_asl_groupadd.rb
316
- - test/test_asl_useradd.rb
317
- - test/test_user_home_directory.rb
318
- - test/test_asl_groupmod.rb
319
304
  - test/test_entry.rb
320
- - test/test_password.rb
321
305
  - test/test_asl_purge.rb
322
- - test/test_asl_groupdel.rb
323
- - test/test_asl_populate.rb
324
- - test/test_asl_userdel.rb
306
+ - test/test_asl_groupmod.rb
325
307
  - test/test_asl_groupshow.rb
308
+ - test/test_samba_encrypt.rb
309
+ - test/test_asl_userdel.rb
310
+ - test/test_asl_populate.rb
311
+ - test/test_asl_groupadd.rb
312
+ - test/test_asl_usermod.rb
313
+ - test/test_asl_useradd.rb
314
+ - test/test_asl_usershow.rb
315
+ - test/test_user_home_directory.rb
@@ -1,275 +0,0 @@
1
- class TestUnitFixture < Test::Unit::TestCase
2
- def test_setup_without_option
3
- test_case = assert_setup([:setup,
4
- :custom_setup_method0,
5
- :custom_setup_method1,
6
- :custom_setup_method3],
7
- [])
8
- assert_inherited_setup([:setup,
9
- :custom_setup_method0,
10
- :custom_setup_method1,
11
- :custom_setup_method3],
12
- test_case)
13
- assert_inherited_setup([:setup], nil)
14
- end
15
-
16
- def test_setup_with_before_option
17
- test_case = assert_setup([:custom_setup_method3,
18
- :custom_setup_method0,
19
- :custom_setup_method1,
20
- :setup],
21
- [[{:before => :append}],
22
- [{:before => :append}],
23
- [{:before => :prepend}],
24
- [{:before => :prepend}]])
25
- assert_inherited_setup([:custom_setup_method3,
26
- :custom_setup_method0,
27
- :custom_setup_method1,
28
- :setup],
29
- test_case)
30
- assert_inherited_setup([:setup], nil)
31
- end
32
-
33
- def test_setup_with_after_option
34
- test_case = assert_setup([:setup,
35
- :custom_setup_method3,
36
- :custom_setup_method0,
37
- :custom_setup_method1],
38
- [[{:after => :append}],
39
- [{:after => :append}],
40
- [{:after => :prepend}],
41
- [{:after => :prepend}]])
42
- assert_inherited_setup([:setup,
43
- :custom_setup_method3,
44
- :custom_setup_method0,
45
- :custom_setup_method1],
46
- test_case)
47
- assert_inherited_setup([:setup], nil)
48
- end
49
-
50
- def test_setup_with_invalid_option
51
- assert_invalid_setup_option(:unknown => true)
52
- assert_invalid_setup_option(:before => :unknown)
53
- assert_invalid_setup_option(:after => :unknown)
54
- end
55
-
56
- def test_teardown_without_option
57
- test_case = assert_teardown([:custom_teardown_method3,
58
- :custom_teardown_method1,
59
- :custom_teardown_method0,
60
- :teardown],
61
- [])
62
- assert_inherited_teardown([:custom_teardown_method3,
63
- :custom_teardown_method1,
64
- :custom_teardown_method0,
65
- :teardown],
66
- test_case)
67
- assert_inherited_teardown([:teardown], nil)
68
- end
69
-
70
- def test_teardown_with_before_option
71
- test_case = assert_teardown([:custom_teardown_method3,
72
- :custom_teardown_method0,
73
- :custom_teardown_method1,
74
- :teardown],
75
- [[{:before => :append}],
76
- [{:before => :append}],
77
- [{:before => :prepend}],
78
- [{:before => :prepend}]])
79
- assert_inherited_teardown([:custom_teardown_method3,
80
- :custom_teardown_method0,
81
- :custom_teardown_method1,
82
- :teardown],
83
- test_case)
84
- assert_inherited_teardown([:teardown], nil)
85
- end
86
-
87
- def test_teardown_with_after_option
88
- test_case = assert_teardown([:teardown,
89
- :custom_teardown_method3,
90
- :custom_teardown_method0,
91
- :custom_teardown_method1],
92
- [[{:after => :append}],
93
- [{:after => :append}],
94
- [{:after => :prepend}],
95
- [{:after => :prepend}]])
96
- assert_inherited_teardown([:teardown,
97
- :custom_teardown_method3,
98
- :custom_teardown_method0,
99
- :custom_teardown_method1],
100
- test_case)
101
- assert_inherited_teardown([:teardown], nil)
102
- end
103
-
104
- def test_teardown_with_invalid_option
105
- assert_invalid_teardown_option(:unknown => true)
106
- assert_invalid_teardown_option(:before => :unknown)
107
- assert_invalid_teardown_option(:after => :unknown)
108
- end
109
-
110
- private
111
- def assert_setup(expected, setup_options)
112
- called = []
113
- test_case = Class.new(Test::Unit::TestCase) do
114
- @@called = called
115
- def setup
116
- @@called << :setup
117
- end
118
-
119
- setup(*(setup_options[0] || []))
120
- def custom_setup_method0
121
- @@called << :custom_setup_method0
122
- end
123
-
124
- def custom_setup_method1
125
- @@called << :custom_setup_method1
126
- end
127
- setup(*[:custom_setup_method1, *(setup_options[1] || [])])
128
-
129
- setup(*(setup_options[2] || []))
130
- def custom_setup_method2
131
- @@called << :custom_setup_method2
132
- end
133
- unregister_setup(:custom_setup_method2)
134
-
135
- setup(*(setup_options[3] || []))
136
- def custom_setup_method3
137
- @@called << :custom_setup_method3
138
- end
139
-
140
- def test_nothing
141
- end
142
- end
143
-
144
- test_case.new("test_nothing").run(Test::Unit::TestResult.new) {}
145
- assert_equal(expected, called)
146
- test_case
147
- end
148
-
149
- def assert_inherited_setup(expected, parent)
150
- called = []
151
- inherited_test_case = Class.new(parent || Test::Unit::TestCase) do
152
- @@called = called
153
- def setup
154
- @@called << :setup
155
- end
156
-
157
- def custom_setup_method0
158
- @@called << :custom_setup_method0
159
- end
160
-
161
- def custom_setup_method1
162
- @@called << :custom_setup_method1
163
- end
164
-
165
- def custom_setup_method2
166
- @@called << :custom_setup_method2
167
- end
168
-
169
- def custom_setup_method3
170
- @@called << :custom_setup_method3
171
- end
172
-
173
- def test_nothing
174
- end
175
- end
176
-
177
- inherited_test_case.new("test_nothing").run(Test::Unit::TestResult.new) {}
178
- assert_equal(expected, called)
179
- end
180
-
181
- def assert_teardown(expected, teardown_options)
182
- called = []
183
- test_case = Class.new(Test::Unit::TestCase) do
184
- @@called = called
185
- def teardown
186
- @@called << :teardown
187
- end
188
-
189
- teardown(*(teardown_options[0] || []))
190
- def custom_teardown_method0
191
- @@called << :custom_teardown_method0
192
- end
193
-
194
- def custom_teardown_method1
195
- @@called << :custom_teardown_method1
196
- end
197
- teardown(*[:custom_teardown_method1, *(teardown_options[1] || [])])
198
-
199
- teardown(*(teardown_options[2] || []))
200
- def custom_teardown_method2
201
- @@called << :custom_teardown_method2
202
- end
203
- unregister_teardown(:custom_teardown_method2)
204
-
205
- teardown(*(teardown_options[3] || []))
206
- def custom_teardown_method3
207
- @@called << :custom_teardown_method3
208
- end
209
-
210
- def test_nothing
211
- end
212
- end
213
-
214
- test_case.new("test_nothing").run(Test::Unit::TestResult.new) {}
215
- assert_equal(expected, called)
216
- test_case
217
- end
218
-
219
- def assert_inherited_teardown(expected, parent)
220
- called = []
221
- inherited_test_case = Class.new(parent || Test::Unit::TestCase) do
222
- @@called = called
223
- def teardown
224
- @@called << :teardown
225
- end
226
-
227
- def custom_teardown_method0
228
- @@called << :custom_teardown_method0
229
- end
230
-
231
- def custom_teardown_method1
232
- @@called << :custom_teardown_method1
233
- end
234
-
235
- def custom_teardown_method2
236
- @@called << :custom_teardown_method2
237
- end
238
-
239
- def custom_teardown_method3
240
- @@called << :custom_teardown_method3
241
- end
242
-
243
- def test_nothing
244
- end
245
- end
246
-
247
- inherited_test_case.new("test_nothing").run(Test::Unit::TestResult.new) {}
248
- assert_equal(expected, called)
249
- end
250
-
251
- def assert_invalid_option(fixture_type, option)
252
- exception = assert_raise(ArgumentError) do
253
- Class.new(Test::Unit::TestCase) do
254
- def test_nothing
255
- end
256
-
257
- send(fixture_type, option)
258
- def fixture
259
- end
260
- end
261
- end
262
- assert_equal("must be {:before => :prepend}, {:before => :append}, " +
263
- "{:after => :prepend} or {:after => :append}" +
264
- ": #{option.inspect}",
265
- exception.message)
266
- end
267
-
268
- def assert_invalid_setup_option(option)
269
- assert_invalid_option(:setup, option)
270
- end
271
-
272
- def assert_invalid_teardown_option(option)
273
- assert_invalid_option(:teardown, option)
274
- end
275
- end