test-unit-must 0.0.2 → 0.1.0
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.
- data/README.md +44 -0
- data/lib/test/unit/must.rb +35 -0
- metadata +4 -5
data/README.md
CHANGED
@@ -15,6 +15,8 @@ addition, it politely accommodates [Rails 3's ActiveSupport extensions to
|
|
15
15
|
Test::Unit](
|
16
16
|
http://rails.rubyonrails.org/classes/ActiveSupport/Testing/SetupAndTeardown/ForClassicTestUnit.html).
|
17
17
|
|
18
|
+
[Vim syntax highlighting][test-unit-must.vim] support is also available.
|
19
|
+
|
18
20
|
------------------------------------------------------------------------------
|
19
21
|
Installation
|
20
22
|
------------------------------------------------------------------------------
|
@@ -68,9 +70,15 @@ Reference
|
|
68
70
|
|
69
71
|
Here is the mapping from test-unit-must assertions to [Test::Unit] assertions.
|
70
72
|
|
73
|
+
def must_be_truth message=nil
|
74
|
+
assert, self, message
|
75
|
+
|
71
76
|
def must_alias_method alias_name, original_name, message=nil
|
72
77
|
assert_alias_method self, alias_name, original_name, message
|
73
78
|
|
79
|
+
def must_yield_truth message=nil
|
80
|
+
assert_block, message, &self
|
81
|
+
|
74
82
|
def must_be_boolean message=nil
|
75
83
|
assert_boolean self, message
|
76
84
|
|
@@ -95,6 +103,9 @@ Here is the mapping from test-unit-must assertions to [Test::Unit] assertions.
|
|
95
103
|
def must_not_equal expected, message=nil
|
96
104
|
assert_not_equal expected, self, message
|
97
105
|
|
106
|
+
def must_fail message=nil
|
107
|
+
assert_fail_assertion, message, &self
|
108
|
+
|
98
109
|
def must_be_false message=nil
|
99
110
|
assert_false self, message
|
100
111
|
|
@@ -137,6 +148,18 @@ Here is the mapping from test-unit-must assertions to [Test::Unit] assertions.
|
|
137
148
|
def must_operate operator, argument, message=nil
|
138
149
|
assert_operator self, operator, argument, message
|
139
150
|
|
151
|
+
def must_exist_in_filesystem message=nil
|
152
|
+
assert_path_exist, self, message
|
153
|
+
|
154
|
+
def must_not_exist_in_filesystem message=nil
|
155
|
+
assert_path_not_exist, self, message
|
156
|
+
|
157
|
+
def must_predicate predicate, message=nil
|
158
|
+
assert_predicate, self, predicate, message
|
159
|
+
|
160
|
+
def must_not_predicate predicate, message=nil
|
161
|
+
assert_not_predicate, self, predicate, message
|
162
|
+
|
140
163
|
def must_raise *arguments
|
141
164
|
assert_raise *arguments, &self
|
142
165
|
|
@@ -176,6 +199,26 @@ Here is the mapping from test-unit-must assertions to [Test::Unit] assertions.
|
|
176
199
|
def must_be_true message=nil
|
177
200
|
assert_true self, message
|
178
201
|
|
202
|
+
In addition, the following negative assertions are defined for completeness:
|
203
|
+
|
204
|
+
must_not_be_truth is opposite of must_be_truth
|
205
|
+
must_not_yield_truth is opposite of must_yield_truth
|
206
|
+
must_not_alias_method is opposite of must_alias_method
|
207
|
+
must_not_be_boolean is opposite of must_be_boolean
|
208
|
+
must_not_compare is opposite of must_compare
|
209
|
+
must_not_fail is opposite of must_fail
|
210
|
+
must_not_be_false is opposite of must_be_false
|
211
|
+
must_not_be_instance_of is opposite of must_be_instance_of
|
212
|
+
must_not_be_kind_of is opposite of must_be_kind_of
|
213
|
+
must_not_operate is opposite of must_operate
|
214
|
+
must_not_raise is opposite of must_raise
|
215
|
+
must_not_raise_kind_of is opposite of must_raise_kind_of
|
216
|
+
must_not_raise_message is opposite of must_raise_message
|
217
|
+
must_not_raise_nothing is opposite of must_raise_nothing
|
218
|
+
must_not_throw is opposite of must_throw
|
219
|
+
must_not_throw_nothing is opposite of must_throw_nothing
|
220
|
+
must_not_be_true is opposite of must_be_true
|
221
|
+
|
179
222
|
------------------------------------------------------------------------------
|
180
223
|
License
|
181
224
|
------------------------------------------------------------------------------
|
@@ -184,3 +227,4 @@ Released under the ISC license. See the `lib/test/unit/must.rb` file.
|
|
184
227
|
|
185
228
|
[Test::Unit]: http://test-unit.rubyforge.org/
|
186
229
|
[MiniTest::Spec]: http://rubydoc.info/stdlib/minitest/
|
230
|
+
[test-unit-must.vim]: https://github.com/sunaku/test-unit-must.vim
|
data/lib/test/unit/must.rb
CHANGED
@@ -39,11 +39,21 @@ module Test::Unit::Must
|
|
39
39
|
end
|
40
40
|
|
41
41
|
module Assertions
|
42
|
+
def must_be_truth message=nil
|
43
|
+
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
44
|
+
:assert, self, message
|
45
|
+
end
|
46
|
+
|
42
47
|
def must_alias_method alias_name, original_name, message=nil
|
43
48
|
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
44
49
|
:assert_alias_method, self, alias_name, original_name, message
|
45
50
|
end
|
46
51
|
|
52
|
+
def must_yield_truth message=nil
|
53
|
+
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
54
|
+
:assert_block, message, &self
|
55
|
+
end
|
56
|
+
|
47
57
|
def must_be_boolean message=nil
|
48
58
|
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
49
59
|
:assert_boolean, self, message
|
@@ -84,6 +94,11 @@ module Test::Unit::Must
|
|
84
94
|
:assert_not_equal, expected, self, message
|
85
95
|
end
|
86
96
|
|
97
|
+
def must_fail message=nil
|
98
|
+
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
99
|
+
:assert_fail_assertion, message, &self
|
100
|
+
end
|
101
|
+
|
87
102
|
def must_be_false message=nil
|
88
103
|
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
89
104
|
:assert_false, self, message
|
@@ -154,6 +169,26 @@ module Test::Unit::Must
|
|
154
169
|
:assert_operator, self, operator, argument, message
|
155
170
|
end
|
156
171
|
|
172
|
+
def must_exist_in_filesystem message=nil
|
173
|
+
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
174
|
+
:assert_path_exist, self, message
|
175
|
+
end
|
176
|
+
|
177
|
+
def must_not_exist_in_filesystem message=nil
|
178
|
+
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
179
|
+
:assert_path_not_exist, self, message
|
180
|
+
end
|
181
|
+
|
182
|
+
def must_predicate predicate, message=nil
|
183
|
+
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
184
|
+
:assert_predicate, self, predicate, message
|
185
|
+
end
|
186
|
+
|
187
|
+
def must_not_predicate predicate, message=nil
|
188
|
+
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
189
|
+
:assert_not_predicate, self, predicate, message
|
190
|
+
end
|
191
|
+
|
157
192
|
def must_raise *arguments
|
158
193
|
$ebb6cc8f_e966_4d1f_969f_530ea365eb36.send \
|
159
194
|
:assert_raise, *arguments, &self
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: test-unit-must
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0
|
5
|
+
version: 0.1.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Suraj N. Kurapati
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable:
|
13
|
+
date: 2011-05-01 00:00:00 Z
|
15
14
|
dependencies: []
|
16
15
|
|
17
16
|
description:
|
@@ -25,7 +24,6 @@ extra_rdoc_files: []
|
|
25
24
|
files:
|
26
25
|
- README.md
|
27
26
|
- lib/test/unit/must.rb
|
28
|
-
has_rdoc: true
|
29
27
|
homepage: http://github.com/sunaku/test-unit-must
|
30
28
|
licenses: []
|
31
29
|
|
@@ -49,9 +47,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
47
|
requirements: []
|
50
48
|
|
51
49
|
rubyforge_project:
|
52
|
-
rubygems_version: 1.
|
50
|
+
rubygems_version: 1.7.2
|
53
51
|
signing_key:
|
54
52
|
specification_version: 3
|
55
53
|
summary: Selfish "must" assertions for Test::Unit
|
56
54
|
test_files: []
|
57
55
|
|
56
|
+
has_rdoc:
|