activesambaldap 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.en +6 -1
- data/NEWS.ja +6 -1
- data/README.en +3 -2
- data/README.ja +3 -2
- data/Rakefile +21 -2
- data/bin/asl-groupadd +0 -0
- data/bin/asl-groupadd.help +15 -0
- data/bin/asl-groupdel +0 -0
- data/bin/asl-groupdel.help +12 -0
- data/bin/asl-groupmod +0 -0
- data/bin/asl-groupmod.help +18 -0
- data/bin/asl-groupshow +0 -0
- data/bin/asl-groupshow.help +10 -0
- data/bin/asl-passwd +0 -0
- data/bin/asl-passwd.help +14 -0
- data/bin/asl-populate +0 -0
- data/bin/asl-populate.help +27 -0
- data/bin/asl-purge +0 -0
- data/bin/asl-purge.help +10 -0
- data/bin/asl-samba-computeradd +0 -0
- data/bin/asl-samba-computeradd.help +12 -0
- data/bin/asl-samba-groupadd +0 -0
- data/bin/asl-samba-groupadd.help +10 -0
- data/bin/asl-samba-groupdel +0 -0
- data/bin/asl-samba-groupdel.help +10 -0
- data/bin/asl-samba-groupmod +0 -0
- data/bin/asl-samba-groupmod.help +14 -0
- data/bin/asl-samba-useradd +0 -0
- data/bin/asl-samba-useradd.help +12 -0
- data/bin/asl-samba-userdel +0 -0
- data/bin/asl-samba-userdel.help +10 -0
- data/bin/asl-samba-usermod +0 -0
- data/bin/asl-samba-usermod.help +14 -0
- data/bin/asl-useradd +0 -0
- data/bin/asl-useradd.help +47 -0
- data/bin/asl-userdel +0 -0
- data/bin/asl-userdel.help +17 -0
- data/bin/asl-usermod +0 -0
- data/bin/asl-usermod.help +45 -0
- data/bin/asl-usershow +0 -0
- data/bin/asl-usershow.help +10 -0
- data/lib/active_samba_ldap.rb +9 -3
- data/lib/active_samba_ldap/account_entry.rb +1 -1
- data/lib/active_samba_ldap/group_entry.rb +3 -5
- data/lib/active_samba_ldap/reloadable.rb +2 -0
- data/lib/active_samba_ldap/samba_group_entry.rb +1 -1
- data/lib/active_samba_ldap/version.rb +1 -1
- data/misc/rd2html.rb +1 -1
- data/rails/plugin/active_samba_ldap/init.rb +15 -0
- data/test-unit/History.txt +32 -0
- data/test-unit/README.txt +32 -0
- data/test-unit/Rakefile +22 -0
- data/test-unit/bin/testrb +5 -0
- data/test-unit/lib/test/unit.rb +280 -0
- data/test-unit/lib/test/unit/assertionfailederror.rb +14 -0
- data/test-unit/lib/test/unit/assertions.rb +722 -0
- data/test-unit/lib/test/unit/attribute.rb +125 -0
- data/test-unit/lib/test/unit/autorunner.rb +250 -0
- data/test-unit/lib/test/unit/collector.rb +43 -0
- data/test-unit/lib/test/unit/collector/descendant.rb +23 -0
- data/test-unit/lib/test/unit/collector/dir.rb +108 -0
- data/test-unit/lib/test/unit/collector/load.rb +135 -0
- data/test-unit/lib/test/unit/collector/objectspace.rb +34 -0
- data/test-unit/lib/test/unit/color.rb +61 -0
- data/test-unit/lib/test/unit/diff.rb +524 -0
- data/test-unit/lib/test/unit/error.rb +124 -0
- data/test-unit/lib/test/unit/exceptionhandler.rb +39 -0
- data/test-unit/lib/test/unit/failure.rb +110 -0
- data/test-unit/lib/test/unit/fixture.rb +185 -0
- data/test-unit/lib/test/unit/notification.rb +116 -0
- data/test-unit/lib/test/unit/omission.rb +129 -0
- data/test-unit/lib/test/unit/pending.rb +130 -0
- data/test-unit/lib/test/unit/priority.rb +146 -0
- data/test-unit/lib/test/unit/runner/console.rb +46 -0
- data/test-unit/lib/test/unit/runner/emacs.rb +8 -0
- data/test-unit/lib/test/unit/testcase.rb +174 -0
- data/test-unit/lib/test/unit/testresult.rb +89 -0
- data/test-unit/lib/test/unit/testsuite.rb +110 -0
- data/test-unit/lib/test/unit/ui/console/outputlevel.rb +14 -0
- data/test-unit/lib/test/unit/ui/console/testrunner.rb +195 -0
- data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +49 -0
- data/test-unit/lib/test/unit/ui/testrunner.rb +20 -0
- data/test-unit/lib/test/unit/ui/testrunnermediator.rb +77 -0
- data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +41 -0
- data/test-unit/lib/test/unit/util/backtracefilter.rb +41 -0
- data/test-unit/lib/test/unit/util/observable.rb +90 -0
- data/test-unit/lib/test/unit/util/procwrapper.rb +48 -0
- data/test-unit/lib/test/unit/version.rb +7 -0
- data/test-unit/sample/adder.rb +13 -0
- data/test-unit/sample/subtracter.rb +12 -0
- data/test-unit/sample/tc_adder.rb +18 -0
- data/test-unit/sample/tc_subtracter.rb +18 -0
- data/test-unit/sample/ts_examples.rb +7 -0
- data/test-unit/test/collector/test_descendant.rb +135 -0
- data/test-unit/test/collector/test_dir.rb +406 -0
- data/test-unit/test/collector/test_load.rb +333 -0
- data/test-unit/test/collector/test_objectspace.rb +98 -0
- data/test-unit/test/run-test.rb +13 -0
- data/test-unit/test/test_assertions.rb +693 -0
- data/test-unit/test/test_attribute.rb +86 -0
- data/test-unit/test/test_color.rb +37 -0
- data/test-unit/test/test_diff.rb +477 -0
- data/test-unit/test/test_emacs_runner.rb +60 -0
- data/test-unit/test/test_error.rb +26 -0
- data/test-unit/test/test_failure.rb +33 -0
- data/test-unit/test/test_fixture.rb +275 -0
- data/test-unit/test/test_notification.rb +33 -0
- data/test-unit/test/test_omission.rb +81 -0
- data/test-unit/test/test_pending.rb +64 -0
- data/test-unit/test/test_priority.rb +89 -0
- data/test-unit/test/test_testcase.rb +411 -0
- data/test-unit/test/test_testresult.rb +113 -0
- data/test-unit/test/test_testsuite.rb +129 -0
- data/test-unit/test/testunit_test_util.rb +12 -0
- data/test-unit/test/ui/test_testrunmediator.rb +20 -0
- data/test-unit/test/util/test_backtracefilter.rb +41 -0
- data/test-unit/test/util/test_observable.rb +102 -0
- data/test-unit/test/util/test_procwrapper.rb +36 -0
- data/test/asl-test-utils.rb +0 -1
- data/test/run-test.rb +8 -12
- data/test/test_asl_groupmod.rb +3 -1
- data/test/test_asl_useradd.rb +3 -3
- data/test/test_samba_encrypt.rb +0 -1
- metadata +225 -88
- data/po/active-samba-ldap.pot +0 -459
- data/test/test-unit-ext.rb +0 -4
- data/test/test-unit-ext/always-show-result.rb +0 -28
- data/test/test-unit-ext/backtrace-filter.rb +0 -17
- data/test/test-unit-ext/long-display-for-emacs.rb +0 -25
- data/test/test-unit-ext/priority.rb +0 -186
@@ -0,0 +1,116 @@
|
|
1
|
+
require 'test/unit/util/backtracefilter'
|
2
|
+
|
3
|
+
module Test
|
4
|
+
module Unit
|
5
|
+
class Notification
|
6
|
+
include Util::BacktraceFilter
|
7
|
+
attr_reader :test_name, :location, :message
|
8
|
+
|
9
|
+
SINGLE_CHARACTER = 'N'
|
10
|
+
LABEL = "Notification"
|
11
|
+
|
12
|
+
# Creates a new Notification with the given location and
|
13
|
+
# message.
|
14
|
+
def initialize(test_name, location, message)
|
15
|
+
@test_name = test_name
|
16
|
+
@location = location
|
17
|
+
@message = message
|
18
|
+
end
|
19
|
+
|
20
|
+
# Returns a single character representation of a notification.
|
21
|
+
def single_character_display
|
22
|
+
SINGLE_CHARACTER
|
23
|
+
end
|
24
|
+
|
25
|
+
def label
|
26
|
+
LABEL
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns a brief version of the error description.
|
30
|
+
def short_display
|
31
|
+
"#{@test_name}: #{@message.split("\n")[0]}"
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns a verbose version of the error description.
|
35
|
+
def long_display
|
36
|
+
backtrace = filter_backtrace(location).join("\n")
|
37
|
+
"#{label}: #{@message}\n#{@test_name}\n#{backtrace}"
|
38
|
+
end
|
39
|
+
|
40
|
+
# Overridden to return long_display.
|
41
|
+
def to_s
|
42
|
+
long_display
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class NotifiedError < StandardError
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
module TestCaseNotificationSupport
|
51
|
+
class << self
|
52
|
+
def included(base)
|
53
|
+
base.class_eval do
|
54
|
+
include NotificationHandler
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def notify(message, &block)
|
60
|
+
notification = Notification.new(name, filter_backtrace(caller), message)
|
61
|
+
add_notification(notification)
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
def add_notification(notification)
|
66
|
+
current_result.add_notification(notification)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
module NotificationHandler
|
71
|
+
class << self
|
72
|
+
def included(base)
|
73
|
+
base.exception_handler(:handle_Notified_error)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
def handle_Notified_error(exception)
|
79
|
+
return false unless exception.is_a?(NotifiedError)
|
80
|
+
notification = Notification.new(name,
|
81
|
+
filter_backtrace(exception.backtrace),
|
82
|
+
exception.message)
|
83
|
+
add_notification(notification)
|
84
|
+
true
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
module TestResultNotificationSupport
|
89
|
+
attr_reader :notifications
|
90
|
+
|
91
|
+
# Records a Test::Unit::Notification.
|
92
|
+
def add_notification(notification)
|
93
|
+
@notifications << notification
|
94
|
+
notify_fault(notification)
|
95
|
+
notify_changed
|
96
|
+
end
|
97
|
+
|
98
|
+
# Returns the number of notifications this TestResult has
|
99
|
+
# recorded.
|
100
|
+
def notification_count
|
101
|
+
@notifications.size
|
102
|
+
end
|
103
|
+
|
104
|
+
private
|
105
|
+
def initialize_containers
|
106
|
+
super
|
107
|
+
@notifications = []
|
108
|
+
@summary_generators << :notification_summary
|
109
|
+
end
|
110
|
+
|
111
|
+
def notification_summary
|
112
|
+
"#{notification_count} notifications"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
require 'test/unit/util/backtracefilter'
|
2
|
+
|
3
|
+
module Test
|
4
|
+
module Unit
|
5
|
+
class Omission
|
6
|
+
include Util::BacktraceFilter
|
7
|
+
attr_reader :test_name, :location, :message
|
8
|
+
|
9
|
+
SINGLE_CHARACTER = 'O'
|
10
|
+
LABEL = "Omission"
|
11
|
+
|
12
|
+
# Creates a new Omission with the given location and
|
13
|
+
# message.
|
14
|
+
def initialize(test_name, location, message)
|
15
|
+
@test_name = test_name
|
16
|
+
@location = location
|
17
|
+
@message = message
|
18
|
+
end
|
19
|
+
|
20
|
+
# Returns a single character representation of a omission.
|
21
|
+
def single_character_display
|
22
|
+
SINGLE_CHARACTER
|
23
|
+
end
|
24
|
+
|
25
|
+
def label
|
26
|
+
LABEL
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns a brief version of the error description.
|
30
|
+
def short_display
|
31
|
+
"#{@test_name}: #{@message.split("\n")[0]}"
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns a verbose version of the error description.
|
35
|
+
def long_display
|
36
|
+
backtrace = filter_backtrace(location).join("\n")
|
37
|
+
"#{label}: #{@message}\n#{@test_name}\n#{backtrace}"
|
38
|
+
end
|
39
|
+
|
40
|
+
# Overridden to return long_display.
|
41
|
+
def to_s
|
42
|
+
long_display
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class OmittedError < StandardError
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
module TestCaseOmissionSupport
|
51
|
+
class << self
|
52
|
+
def included(base)
|
53
|
+
base.class_eval do
|
54
|
+
include OmissionHandler
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def omit(message=nil, &block)
|
60
|
+
message ||= "omitted."
|
61
|
+
if block_given?
|
62
|
+
omission = Omission.new(name, filter_backtrace(caller), message)
|
63
|
+
add_omission(omission)
|
64
|
+
else
|
65
|
+
raise OmittedError.new(message)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def omit_if(condition, *args, &block)
|
70
|
+
omit(*args, &block) if condition
|
71
|
+
end
|
72
|
+
|
73
|
+
def omit_unless(condition, *args, &block)
|
74
|
+
omit(*args, &block) unless condition
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
def add_omission(omission)
|
79
|
+
current_result.add_omission(omission)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
module OmissionHandler
|
84
|
+
class << self
|
85
|
+
def included(base)
|
86
|
+
base.exception_handler(:handle_omitted_error)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
private
|
91
|
+
def handle_omitted_error(exception)
|
92
|
+
return false unless exception.is_a?(OmittedError)
|
93
|
+
omission = Omission.new(name,
|
94
|
+
filter_backtrace(exception.backtrace),
|
95
|
+
exception.message)
|
96
|
+
add_omission(omission)
|
97
|
+
true
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
module TestResultOmissionSupport
|
102
|
+
attr_reader :omissions
|
103
|
+
|
104
|
+
# Records a Test::Unit::Omission.
|
105
|
+
def add_omission(omission)
|
106
|
+
@omissions << omission
|
107
|
+
notify_fault(omission)
|
108
|
+
notify_changed
|
109
|
+
end
|
110
|
+
|
111
|
+
# Returns the number of omissions this TestResult has
|
112
|
+
# recorded.
|
113
|
+
def omission_count
|
114
|
+
@omissions.size
|
115
|
+
end
|
116
|
+
|
117
|
+
private
|
118
|
+
def initialize_containers
|
119
|
+
super
|
120
|
+
@omissions = []
|
121
|
+
@summary_generators << :omission_summary
|
122
|
+
end
|
123
|
+
|
124
|
+
def omission_summary
|
125
|
+
"#{omission_count} omissions"
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
require 'test/unit/util/backtracefilter'
|
2
|
+
|
3
|
+
module Test
|
4
|
+
module Unit
|
5
|
+
class Pending
|
6
|
+
include Util::BacktraceFilter
|
7
|
+
attr_reader :test_name, :location, :message
|
8
|
+
|
9
|
+
SINGLE_CHARACTER = 'P'
|
10
|
+
LABEL = "Pending"
|
11
|
+
|
12
|
+
# Creates a new Pending with the given location and
|
13
|
+
# message.
|
14
|
+
def initialize(test_name, location, message)
|
15
|
+
@test_name = test_name
|
16
|
+
@location = location
|
17
|
+
@message = message
|
18
|
+
end
|
19
|
+
|
20
|
+
# Returns a single character representation of a pending.
|
21
|
+
def single_character_display
|
22
|
+
SINGLE_CHARACTER
|
23
|
+
end
|
24
|
+
|
25
|
+
def label
|
26
|
+
LABEL
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns a brief version of the error description.
|
30
|
+
def short_display
|
31
|
+
"#{@test_name}: #{@message.split("\n")[0]}"
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns a verbose version of the error description.
|
35
|
+
def long_display
|
36
|
+
backtrace = filter_backtrace(location).join("\n")
|
37
|
+
"#{label}: #{@message}\n#{@test_name}\n#{backtrace}"
|
38
|
+
end
|
39
|
+
|
40
|
+
# Overridden to return long_display.
|
41
|
+
def to_s
|
42
|
+
long_display
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class PendedError < StandardError
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
module TestCasePendingSupport
|
51
|
+
class << self
|
52
|
+
def included(base)
|
53
|
+
base.class_eval do
|
54
|
+
include PendingHandler
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def pend(message=nil, &block)
|
60
|
+
message ||= "pended."
|
61
|
+
if block_given?
|
62
|
+
pending = nil
|
63
|
+
begin
|
64
|
+
yield
|
65
|
+
rescue Exception
|
66
|
+
pending = Pending.new(name, filter_backtrace(caller), message)
|
67
|
+
add_pending(pending)
|
68
|
+
end
|
69
|
+
unless pending
|
70
|
+
flunk("Pending block should not be passed: #{message}")
|
71
|
+
end
|
72
|
+
else
|
73
|
+
raise PendedError.new(message)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
def add_pending(pending)
|
79
|
+
problem_occurred
|
80
|
+
current_result.add_pending(pending)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
module PendingHandler
|
85
|
+
class << self
|
86
|
+
def included(base)
|
87
|
+
base.exception_handler(:handle_pended_error)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
private
|
92
|
+
def handle_pended_error(exception)
|
93
|
+
return false unless exception.is_a?(PendedError)
|
94
|
+
pending = Pending.new(name,
|
95
|
+
filter_backtrace(exception.backtrace),
|
96
|
+
exception.message)
|
97
|
+
add_pending(pending)
|
98
|
+
true
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
module TestResultPendingSupport
|
103
|
+
attr_reader :pendings
|
104
|
+
|
105
|
+
# Records a Test::Unit::Pending.
|
106
|
+
def add_pending(pending)
|
107
|
+
@pendings << pending
|
108
|
+
notify_fault(pending)
|
109
|
+
notify_changed
|
110
|
+
end
|
111
|
+
|
112
|
+
# Returns the number of pendings this TestResult has
|
113
|
+
# recorded.
|
114
|
+
def pending_count
|
115
|
+
@pendings.size
|
116
|
+
end
|
117
|
+
|
118
|
+
private
|
119
|
+
def initialize_containers
|
120
|
+
super
|
121
|
+
@pendings = []
|
122
|
+
@summary_generators << :pending_summary
|
123
|
+
end
|
124
|
+
|
125
|
+
def pending_summary
|
126
|
+
"#{pending_count} pendings"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
@@ -0,0 +1,146 @@
|
|
1
|
+
require "fileutils"
|
2
|
+
require "tmpdir"
|
3
|
+
|
4
|
+
module Test
|
5
|
+
module Unit
|
6
|
+
module Priority
|
7
|
+
class << self
|
8
|
+
def included(base)
|
9
|
+
base.extend(ClassMethods)
|
10
|
+
|
11
|
+
base.class_eval do
|
12
|
+
setup :priority_setup, :before => :prepend
|
13
|
+
teardown :priority_teardown, :after => :append
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class Checker
|
19
|
+
class << self
|
20
|
+
def have_priority?(name)
|
21
|
+
singleton_class = (class << self; self; end)
|
22
|
+
singleton_class.method_defined?(priority_check_method_name(name))
|
23
|
+
end
|
24
|
+
|
25
|
+
def need_to_run?(test)
|
26
|
+
priority = test[:priority] || :normal
|
27
|
+
if have_priority?(priority)
|
28
|
+
send(priority_check_method_name(priority), test)
|
29
|
+
else
|
30
|
+
true
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def run_priority_must?(test)
|
35
|
+
true
|
36
|
+
end
|
37
|
+
|
38
|
+
def run_priority_important?(test)
|
39
|
+
rand > 0.1
|
40
|
+
end
|
41
|
+
|
42
|
+
def run_priority_high?(test)
|
43
|
+
rand > 0.3
|
44
|
+
end
|
45
|
+
|
46
|
+
def run_priority_normal?(test)
|
47
|
+
rand > 0.5
|
48
|
+
end
|
49
|
+
|
50
|
+
def run_priority_low?(test)
|
51
|
+
rand > 0.75
|
52
|
+
end
|
53
|
+
|
54
|
+
def run_priority_never?(test)
|
55
|
+
false
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
def priority_check_method_name(priority_name)
|
60
|
+
"run_priority_#{priority_name}?"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
attr_reader :test
|
65
|
+
def initialize(test)
|
66
|
+
@test = test
|
67
|
+
end
|
68
|
+
|
69
|
+
def setup
|
70
|
+
FileUtils.rm_f(passed_file)
|
71
|
+
end
|
72
|
+
|
73
|
+
def teardown
|
74
|
+
if @test.send(:passed?)
|
75
|
+
FileUtils.touch(passed_file)
|
76
|
+
else
|
77
|
+
FileUtils.rm_f(passed_file)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def need_to_run?
|
82
|
+
!previous_test_success? or self.class.need_to_run?(@test)
|
83
|
+
end
|
84
|
+
|
85
|
+
private
|
86
|
+
def previous_test_success?
|
87
|
+
File.exist?(passed_file)
|
88
|
+
end
|
89
|
+
|
90
|
+
def result_dir
|
91
|
+
components = [".test-result",
|
92
|
+
@test.class.name || "AnonymousTestCase",
|
93
|
+
@test.method_name.to_s]
|
94
|
+
parent_directories = [File.dirname($0), Dir.pwd]
|
95
|
+
if Process.respond_to?(:uid)
|
96
|
+
parent_directories << File.join(Dir.tmpdir, Process.uid.to_s)
|
97
|
+
end
|
98
|
+
parent_directories.each do |parent_directory|
|
99
|
+
dir = File.expand_path(File.join(parent_directory, *components))
|
100
|
+
begin
|
101
|
+
FileUtils.mkdir_p(dir)
|
102
|
+
return dir
|
103
|
+
rescue Errno::EACCES
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
raise Errno::EACCES, parent_directories.join(", ")
|
108
|
+
end
|
109
|
+
|
110
|
+
def passed_file
|
111
|
+
File.join(result_dir, "passed")
|
112
|
+
end
|
113
|
+
|
114
|
+
def escaped_method_name
|
115
|
+
@method_name.to_s.gsub(/[!?=]$/) do |matched|
|
116
|
+
case matched
|
117
|
+
when "!"
|
118
|
+
".destructive"
|
119
|
+
when "?"
|
120
|
+
".predicate"
|
121
|
+
when "="
|
122
|
+
".equal"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
module ClassMethods
|
129
|
+
def priority(name, *tests)
|
130
|
+
unless Checker.have_priority?(name)
|
131
|
+
raise ArgumentError, "unknown priority: #{name}"
|
132
|
+
end
|
133
|
+
attribute(:priority, name, {:keep => true}, *tests)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def priority_setup
|
138
|
+
Checker.new(self).setup
|
139
|
+
end
|
140
|
+
|
141
|
+
def priority_teardown
|
142
|
+
Checker.new(self).teardown
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|