rubyunit 0.3.16 → 0.3.17
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/RubyUnit/Assertions/Basic.rb +111 -108
- data/lib/RubyUnit/Assertions/Classes.rb +216 -0
- data/lib/RubyUnit/Assertions/Collections.rb +105 -0
- data/lib/RubyUnit/Assertions/Comparisons.rb +205 -0
- data/lib/RubyUnit/Assertions/Exceptions.rb +122 -0
- data/lib/RubyUnit/Assertions/Methods.rb +162 -0
- data/lib/RubyUnit/Assertions/Root.rb +93 -0
- data/lib/RubyUnit/Assertions.rb +22 -97
- data/lib/RubyUnit.rb +16 -9
- data/tests/AssertionFailure/TC_Class.rb +8 -3
- data/tests/AssertionFailure/TC_Instance.rb +13 -26
- data/tests/AssertionFailure/data/Class.rb +13 -0
- data/tests/AssertionFailure/data/Instance.rb +9 -10
- data/tests/Assertions/{TC_Class.rb → TC_Classes.rb} +3 -4
- data/tests/Assertions/TC_Collections.rb +13 -0
- data/tests/Assertions/TC_Comparisons.rb +13 -0
- data/tests/Assertions/TC_Exceptions.rb +13 -0
- data/tests/Assertions/TC_Methods.rb +13 -0
- data/tests/Assertions/data/Basic.rb +2 -2
- data/tests/Assertions/data/{Class.rb → Classes.rb} +1 -1
- data/tests/Assertions/data/Collections.rb +13 -0
- data/tests/Assertions/data/Comparisons.rb +7 -0
- data/tests/Assertions/data/Exceptions.rb +7 -0
- data/tests/Assertions/data/Methods.rb +7 -0
- data/tests/RubyUnit/TC_GemInfo.rb +4 -3
- data/tests/RubyUnit/TC_RubyUnit.rb +8 -7
- data/tests/RubyUnit/data/GemInfo.rb +1 -1
- data/tests/RubyUnit/data/RubyUnit.rb +9 -2
- data/tests/TS_Assertions.rb +2 -4
- metadata +20 -12
- data/lib/RubyUnit/Assertions/Class.rb +0 -198
- data/lib/RubyUnit/Assertions/Collection.rb +0 -80
- data/lib/RubyUnit/Assertions/Comparison.rb +0 -200
- data/lib/RubyUnit/Assertions/Exception.rb +0 -105
- data/lib/RubyUnit/Assertions/Method.rb +0 -157
- data/tests/Assertions/TC_Comparison.rb +0 -13
- data/tests/Assertions/data/Comparison.rb +0 -7
@@ -1,157 +0,0 @@
|
|
1
|
-
module RubyUnit
|
2
|
-
module Assertions
|
3
|
-
include AssertionMessage
|
4
|
-
|
5
|
-
#
|
6
|
-
# Assert that an object responds to particular method
|
7
|
-
# * raises RubyUnit::AssertionFailure unless _object_ responds to _method_
|
8
|
-
#
|
9
|
-
# object::
|
10
|
-
# The object to check
|
11
|
-
#
|
12
|
-
# method::
|
13
|
-
# The method to assert on the object
|
14
|
-
#
|
15
|
-
# message::
|
16
|
-
# The message provided to be reported for a failure
|
17
|
-
#
|
18
|
-
# assertRespondTo /^Regexp/, :length, 'It does not, so... no' # => fail
|
19
|
-
#
|
20
|
-
def assertRespondTo object, method, message = nil
|
21
|
-
__assert (object.respond_to? method), ASSERT_RESPOND_TO_ERROR, message, {:object=>object, :method=>method}
|
22
|
-
end
|
23
|
-
|
24
|
-
#
|
25
|
-
# Assert that an object does not respond to a particular method
|
26
|
-
# * raises RubyUnit::AssertionFailure if _object_ responds to _method_
|
27
|
-
#
|
28
|
-
# object::
|
29
|
-
# The object to check
|
30
|
-
#
|
31
|
-
# method::
|
32
|
-
# The method to assert on the object
|
33
|
-
#
|
34
|
-
# message::
|
35
|
-
# The message provided to be reported for a failure
|
36
|
-
#
|
37
|
-
# assertNotRespondTo 25, :integer?, 'It does, so close' # => fail
|
38
|
-
#
|
39
|
-
def assertNotRespondTo object, method, message = nil
|
40
|
-
__assert (object.respond_to? method), ASSERT_NOT_RESPOND_TO_ERROR, message, {:object=>object, :method=>method}
|
41
|
-
end
|
42
|
-
|
43
|
-
#
|
44
|
-
# Assert that an object has defined the specified method.
|
45
|
-
# * raises RubyUnit::AssertionFailure unless _klass_ has defined _method_
|
46
|
-
#
|
47
|
-
# klass::
|
48
|
-
# The object to check for _method_
|
49
|
-
#
|
50
|
-
# method::
|
51
|
-
# The method to check
|
52
|
-
#
|
53
|
-
# message::
|
54
|
-
# The message provided to be reported for a failure
|
55
|
-
#
|
56
|
-
# assertMethod String, :integer?, 'Nope' # => fail
|
57
|
-
#
|
58
|
-
def assertMethod klass, method, message = nil
|
59
|
-
assertInclude klass.methods, method, message
|
60
|
-
end
|
61
|
-
|
62
|
-
#
|
63
|
-
# Assert that an object has not defined the specified method.
|
64
|
-
# * raises RubyUnit::AssertionFailure if _klass_ has defined _method_
|
65
|
-
#
|
66
|
-
# klass::
|
67
|
-
# The object to check for _method_
|
68
|
-
#
|
69
|
-
# method::
|
70
|
-
# The method to check
|
71
|
-
#
|
72
|
-
# message::
|
73
|
-
# The message provided to be reported for a failure
|
74
|
-
#
|
75
|
-
# assertNotMethod Integer, :integer?, 'Nope' # => fail
|
76
|
-
#
|
77
|
-
def assertNotMethod klass, not_method, message = nil
|
78
|
-
assertNotInclude klass.methods, not_method, message
|
79
|
-
end
|
80
|
-
|
81
|
-
#
|
82
|
-
# Assert that an object has defined the specified instance method.
|
83
|
-
# * raises RubyUnit::AssertionFailure unless _klass_ has defined _instance_method_
|
84
|
-
#
|
85
|
-
# klass::
|
86
|
-
# The object to check for _instance_method_
|
87
|
-
#
|
88
|
-
# method::
|
89
|
-
# The method to check
|
90
|
-
#
|
91
|
-
# message::
|
92
|
-
# The message provided to be reported for a failure
|
93
|
-
#
|
94
|
-
# assertInstanceMethod String, :integer?, 'Nope' # => fail
|
95
|
-
#
|
96
|
-
def assertInstanceMethod klass, instance_method, message = nil
|
97
|
-
assertInclude klass.instance_methods, instance_method, message
|
98
|
-
end
|
99
|
-
|
100
|
-
#
|
101
|
-
# Assert that an object has not defined the specified instance method.
|
102
|
-
# * raises RubyUnit::AssertionFailure unless _klass_ has defined _not_instance_method_
|
103
|
-
#
|
104
|
-
# klass::
|
105
|
-
# The object to check for _not_instance_method_
|
106
|
-
#
|
107
|
-
# method::
|
108
|
-
# The method to check
|
109
|
-
#
|
110
|
-
# message::
|
111
|
-
# The message provided to be reported for a failure
|
112
|
-
#
|
113
|
-
# assertNotInstanceMethod Integer, :integer?, 'Nope' # => fail
|
114
|
-
#
|
115
|
-
def assertNotInstanceMethod klass, not_instance_method, message = nil
|
116
|
-
assertNotInclude klass.instance_methods, not_instance_method, message
|
117
|
-
end
|
118
|
-
|
119
|
-
#
|
120
|
-
# Assert that an Class has defined the specified class method.
|
121
|
-
# * raises RubyUnit::AssertionFailure unless _klass_ has defined _class_method_
|
122
|
-
#
|
123
|
-
# klass::
|
124
|
-
# The object to check for _class_method_
|
125
|
-
#
|
126
|
-
# method::
|
127
|
-
# The method to check
|
128
|
-
#
|
129
|
-
# message::
|
130
|
-
# The message provided to be reported for a failure
|
131
|
-
#
|
132
|
-
# assertClassMethod String, :integer?, 'Nope' # => fail
|
133
|
-
#
|
134
|
-
def assertClassMethod klass, class_method, message = nil
|
135
|
-
assertInclude klass.singleton_methods, class_method, message
|
136
|
-
end
|
137
|
-
|
138
|
-
#
|
139
|
-
# Assert that an Class has not defined the specified class method.
|
140
|
-
# * raises RubyUnit::AssertionFailure unless _klass_ has defined _not_class_method_
|
141
|
-
#
|
142
|
-
# klass::
|
143
|
-
# The object to check for _not_class_method_
|
144
|
-
#
|
145
|
-
# method::
|
146
|
-
# The method to check
|
147
|
-
#
|
148
|
-
# message::
|
149
|
-
# The message provided to be reported for a failure
|
150
|
-
#
|
151
|
-
# assertNotClassMethod String, :new, 'Nope' # => fail
|
152
|
-
#
|
153
|
-
def assertNotClassMethod klass, not_class_method, message = nil
|
154
|
-
assertNotInclude klass.singleton_methods, not_class_method, message
|
155
|
-
end
|
156
|
-
end
|
157
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'RubyUnit/Assertions'
|
2
|
-
|
3
|
-
# Data provider for RubyUnit::TestCase tests
|
4
|
-
require_relative 'data/Comparison'
|
5
|
-
|
6
|
-
module AssertionsTests
|
7
|
-
#
|
8
|
-
# Test Case for RubyUnit::Assertions Comparison assertions
|
9
|
-
#
|
10
|
-
class TC_Comparison < AssertionsTestCase
|
11
|
-
include ComparisonData
|
12
|
-
end
|
13
|
-
end
|