verbs 2.2.1 → 3.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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +14 -14
- data/.gitignore +2 -0
- data/.rubocop.yml +21 -0
- data/.rubocop_todo.yml +55 -0
- data/CHANGELOG.md +161 -0
- data/Gemfile +3 -1
- data/README.md +85 -0
- data/Rakefile +7 -4
- data/bin/console +15 -0
- data/lib/verbs/conjugations.rb +201 -31
- data/lib/verbs/conjugator.rb +128 -78
- data/lib/verbs/improper_construction.rb +3 -1
- data/lib/verbs/verb.rb +21 -12
- data/lib/verbs/verblike.rb +6 -4
- data/lib/verbs/version.rb +3 -1
- data/lib/verbs.rb +10 -3
- data/tasks/release.rake +8 -0
- data/test/helper.rb +2 -3
- data/test/test_verbs.rb +348 -105
- data/verbs.gemspec +16 -14
- metadata +28 -9
- data/README.rdoc +0 -77
- data/VERSION +0 -1
data/tasks/release.rake
ADDED
data/test/helper.rb
CHANGED
data/test/test_verbs.rb
CHANGED
@@ -1,149 +1,324 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'helper'
|
2
4
|
|
3
5
|
class TestVerbs < Test::Unit::TestCase
|
4
6
|
def test_copular_conjugation
|
5
7
|
# present habitual
|
6
|
-
assert_equal 'am',
|
7
|
-
|
8
|
-
|
9
|
-
assert_equal 'are',
|
10
|
-
|
8
|
+
assert_equal 'am',
|
9
|
+
Verbs::Conjugator.conjugate(:be, tense: :present, person: :first, plurality: :singular,
|
10
|
+
aspect: :habitual)
|
11
|
+
assert_equal 'are',
|
12
|
+
Verbs::Conjugator.conjugate(:be, tense: :present, person: :second, plurality: :singular,
|
13
|
+
aspect: :habitual)
|
14
|
+
assert_equal 'is',
|
15
|
+
Verbs::Conjugator.conjugate(:be, tense: :present, person: :third, plurality: :singular,
|
16
|
+
aspect: :habitual)
|
17
|
+
assert_equal 'are',
|
18
|
+
Verbs::Conjugator.conjugate(:be, tense: :present, person: :first, plurality: :plural,
|
19
|
+
aspect: :habitual)
|
20
|
+
assert_equal 'are',
|
21
|
+
Verbs::Conjugator.conjugate(:be, tense: :present, person: :third, plurality: :plural,
|
22
|
+
aspect: :habitual)
|
23
|
+
|
24
|
+
# past
|
25
|
+
assert_equal 'was', Verbs::Conjugator.conjugate(:be, tense: :past)
|
11
26
|
|
12
27
|
# past habitual
|
13
|
-
assert_equal 'used to be',
|
14
|
-
|
15
|
-
assert_equal 'used to be',
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
assert_equal '
|
21
|
-
|
22
|
-
assert_equal '
|
23
|
-
|
24
|
-
|
25
|
-
assert_equal 'was
|
26
|
-
|
27
|
-
|
28
|
+
assert_equal 'used to be',
|
29
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :first, plurality: :singular, aspect: :habitual)
|
30
|
+
assert_equal 'used to be',
|
31
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :second, plurality: :singular,
|
32
|
+
aspect: :habitual)
|
33
|
+
assert_equal 'used to be',
|
34
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :third, plurality: :singular, aspect: :habitual)
|
35
|
+
assert_equal 'used to be',
|
36
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :first, plurality: :plural, aspect: :habitual)
|
37
|
+
assert_equal 'used to be',
|
38
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :third, plurality: :plural, aspect: :habitual)
|
39
|
+
|
40
|
+
assert_equal 'was',
|
41
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :first, plurality: :singular,
|
42
|
+
aspect: :perfective)
|
43
|
+
assert_equal 'were',
|
44
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :second, plurality: :singular,
|
45
|
+
aspect: :perfective)
|
46
|
+
assert_equal 'was',
|
47
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :third, plurality: :singular,
|
48
|
+
aspect: :perfective)
|
49
|
+
assert_equal 'were',
|
50
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :first, plurality: :plural, aspect: :perfective)
|
51
|
+
assert_equal 'were',
|
52
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :third, plurality: :plural, aspect: :perfective)
|
53
|
+
|
54
|
+
assert_equal 'was being',
|
55
|
+
Verbs::Conjugator.conjugate(:be, tense: :past, person: :third, aspect: :progressive)
|
56
|
+
assert_equal 'is being',
|
57
|
+
Verbs::Conjugator.conjugate(:be, tense: :present, person: :third, aspect: :progressive)
|
58
|
+
assert_equal 'will be being',
|
59
|
+
Verbs::Conjugator.conjugate(:be, tense: :future, person: :third, aspect: :progressive)
|
28
60
|
end
|
61
|
+
|
29
62
|
def test_irregular_conjugation
|
30
|
-
assert_equal 'break',
|
31
|
-
|
32
|
-
|
33
|
-
assert_equal 'break',
|
34
|
-
|
35
|
-
|
36
|
-
assert_equal '
|
37
|
-
|
38
|
-
|
39
|
-
assert_equal '
|
40
|
-
|
63
|
+
assert_equal 'break',
|
64
|
+
Verbs::Conjugator.conjugate(:break, tense: :present, person: :first, plurality: :singular,
|
65
|
+
aspect: :habitual)
|
66
|
+
assert_equal 'break',
|
67
|
+
Verbs::Conjugator.conjugate(:break, tense: :present, person: :second, plurality: :singular,
|
68
|
+
aspect: :habitual)
|
69
|
+
assert_equal 'breaks',
|
70
|
+
Verbs::Conjugator.conjugate(:break, tense: :present, person: :third, plurality: :singular,
|
71
|
+
aspect: :habitual)
|
72
|
+
assert_equal 'break',
|
73
|
+
Verbs::Conjugator.conjugate(:break, tense: :present, person: :first, plurality: :plural,
|
74
|
+
aspect: :habitual)
|
75
|
+
assert_equal 'break',
|
76
|
+
Verbs::Conjugator.conjugate(:break, tense: :present, person: :third, plurality: :plural,
|
77
|
+
aspect: :habitual)
|
78
|
+
assert_equal 'broke',
|
79
|
+
Verbs::Conjugator.conjugate(:break, tense: :past, person: :first, plurality: :singular,
|
80
|
+
aspect: :perfective)
|
81
|
+
assert_equal 'broke',
|
82
|
+
Verbs::Conjugator.conjugate(:break, tense: :past, person: :first, plurality: :singular,
|
83
|
+
aspect: :perfective)
|
84
|
+
assert_equal 'broke',
|
85
|
+
Verbs::Conjugator.conjugate(:break, tense: :past, person: :first, plurality: :singular,
|
86
|
+
aspect: :perfective)
|
87
|
+
assert_equal 'broke',
|
88
|
+
Verbs::Conjugator.conjugate(:break, tense: :past, person: :first, plurality: :singular,
|
89
|
+
aspect: :perfective)
|
90
|
+
assert_equal 'broke',
|
91
|
+
Verbs::Conjugator.conjugate(:break, tense: :past, person: :first, plurality: :singular,
|
92
|
+
aspect: :perfective)
|
93
|
+
assert_equal 'has',
|
94
|
+
Verbs::Conjugator.conjugate(:have, tense: :present, person: :third, plurality: :singular,
|
95
|
+
aspect: :habitual)
|
41
96
|
end
|
97
|
+
|
42
98
|
def test_know
|
43
|
-
assert_equal '
|
44
|
-
assert_equal '
|
45
|
-
|
99
|
+
assert_equal 'knew', Verbs::Conjugator.conjugate(:know, tense: :past)
|
100
|
+
assert_equal 'had known',
|
101
|
+
Verbs::Conjugator.conjugate(:know, tense: :past, person: :third, plurality: :singular,
|
102
|
+
aspect: :perfect)
|
103
|
+
assert_equal 'knew',
|
104
|
+
Verbs::Conjugator.conjugate(:know, tense: :past, person: :third, plurality: :singular,
|
105
|
+
aspect: :perfective)
|
106
|
+
assert_equal 'was knowing',
|
107
|
+
Verbs::Conjugator.conjugate(:know, tense: :past, person: :third, plurality: :singular,
|
108
|
+
aspect: :progressive)
|
46
109
|
end
|
110
|
+
|
47
111
|
def test_irregular_conjugation_with_terminal_y
|
48
|
-
assert_equal 'flies',
|
49
|
-
|
50
|
-
|
112
|
+
assert_equal 'flies',
|
113
|
+
Verbs::Conjugator.conjugate(:fly, tense: :present, person: :third, plurality: :singular,
|
114
|
+
aspect: :habitual)
|
115
|
+
assert_equal 'carried',
|
116
|
+
Verbs::Conjugator.conjugate(:carry, tense: :past, person: :third, plurality: :singular,
|
117
|
+
aspect: :perfective)
|
118
|
+
assert_equal 'stayed',
|
119
|
+
Verbs::Conjugator.conjugate(:stay, tense: :past, person: :third, plurality: :singular,
|
120
|
+
aspect: :perfective)
|
51
121
|
end
|
122
|
+
|
52
123
|
def test_regular_conjugation
|
53
|
-
assert_equal 'accept',
|
54
|
-
|
55
|
-
|
56
|
-
assert_equal 'accept',
|
57
|
-
|
58
|
-
|
59
|
-
assert_equal '
|
60
|
-
|
61
|
-
|
62
|
-
assert_equal '
|
124
|
+
assert_equal 'accept',
|
125
|
+
Verbs::Conjugator.conjugate(:accept, tense: :present, person: :first, plurality: :singular,
|
126
|
+
aspect: :habitual)
|
127
|
+
assert_equal 'accept',
|
128
|
+
Verbs::Conjugator.conjugate(:accept, tense: :present, person: :second, plurality: :singular,
|
129
|
+
aspect: :habitual)
|
130
|
+
assert_equal 'accepts',
|
131
|
+
Verbs::Conjugator.conjugate(:accept, tense: :present, person: :third, plurality: :singular,
|
132
|
+
aspect: :habitual)
|
133
|
+
assert_equal 'accept',
|
134
|
+
Verbs::Conjugator.conjugate(:accept, tense: :present, person: :first, plurality: :plural,
|
135
|
+
aspect: :habitual)
|
136
|
+
assert_equal 'accept',
|
137
|
+
Verbs::Conjugator.conjugate(:accept, tense: :present, person: :third, plurality: :plural,
|
138
|
+
aspect: :habitual)
|
139
|
+
assert_equal 'accepted',
|
140
|
+
Verbs::Conjugator.conjugate(:accept, tense: :past, person: :first, plurality: :singular,
|
141
|
+
aspect: :perfective)
|
142
|
+
assert_equal 'accepted',
|
143
|
+
Verbs::Conjugator.conjugate(:accept, tense: :past, person: :first, plurality: :singular,
|
144
|
+
aspect: :perfective)
|
145
|
+
assert_equal 'accepted',
|
146
|
+
Verbs::Conjugator.conjugate(:accept, tense: :past, person: :first, plurality: :singular,
|
147
|
+
aspect: :perfective)
|
148
|
+
assert_equal 'accepted',
|
149
|
+
Verbs::Conjugator.conjugate(:accept, tense: :past, person: :first, plurality: :singular,
|
150
|
+
aspect: :perfective)
|
151
|
+
assert_equal 'accepted',
|
152
|
+
Verbs::Conjugator.conjugate(:accept, tense: :past, person: :first, plurality: :singular,
|
153
|
+
aspect: :perfective)
|
63
154
|
end
|
155
|
+
|
64
156
|
def test_regular_conjugation_with_terminal_single_consonant
|
65
|
-
assert_equal 'shipped',
|
157
|
+
assert_equal 'shipped',
|
158
|
+
Verbs::Conjugator.conjugate(:ship, tense: :past, person: :first, plurality: :singular,
|
159
|
+
aspect: :perfective)
|
66
160
|
end
|
161
|
+
|
67
162
|
def test_regular_conjugation_with_irregular_terminal_consonant
|
68
|
-
assert_equal 'abandoned',
|
69
|
-
|
70
|
-
|
71
|
-
assert_equal '
|
72
|
-
|
163
|
+
assert_equal 'abandoned',
|
164
|
+
Verbs::Conjugator.conjugate(:abandon, tense: :past, person: :first, plurality: :singular,
|
165
|
+
aspect: :perfective)
|
166
|
+
assert_equal 'followed',
|
167
|
+
Verbs::Conjugator.conjugate(:follow, tense: :past, person: :first, plurality: :singular,
|
168
|
+
aspect: :perfective)
|
169
|
+
assert_equal 'triggered',
|
170
|
+
Verbs::Conjugator.conjugate(:trigger, tense: :past, person: :first, plurality: :singular,
|
171
|
+
aspect: :perfective)
|
172
|
+
assert_equal 'colored',
|
173
|
+
Verbs::Conjugator.conjugate(:color, tense: :past, person: :first, plurality: :singular,
|
174
|
+
aspect: :perfective)
|
175
|
+
assert_equal 'delivered',
|
176
|
+
Verbs::Conjugator.conjugate(:deliver, tense: :past, person: :first, plurality: :singular,
|
177
|
+
aspect: :perfective)
|
73
178
|
end
|
179
|
+
|
74
180
|
def test_regular_conjugation_with_ean_suffix
|
75
|
-
assert_equal 'cleaned',
|
76
|
-
|
181
|
+
assert_equal 'cleaned',
|
182
|
+
Verbs::Conjugator.conjugate(:clean, tense: :past, person: :first, plurality: :singular,
|
183
|
+
aspect: :perfective)
|
184
|
+
assert_equal 'am cleaning',
|
185
|
+
Verbs::Conjugator.conjugate(:clean, tense: :present, person: :first, plurality: :singular,
|
186
|
+
aspect: :progressive)
|
77
187
|
end
|
188
|
+
|
78
189
|
def test_regular_non_doubled_ending_consonant
|
79
|
-
assert_equal 'fixes',
|
80
|
-
|
81
|
-
|
190
|
+
assert_equal 'fixes',
|
191
|
+
Verbs::Conjugator.conjugate(:fix, tense: :present, person: :third, plurality: :singular,
|
192
|
+
aspect: :habitual)
|
193
|
+
assert_equal 'fixed',
|
194
|
+
Verbs::Conjugator.conjugate(:fix, tense: :past, person: :first, plurality: :singular,
|
195
|
+
aspect: :perfective)
|
196
|
+
assert_equal 'faxed',
|
197
|
+
Verbs::Conjugator.conjugate(:fax, tense: :past, person: :first, plurality: :singular,
|
198
|
+
aspect: :perfective)
|
82
199
|
end
|
200
|
+
|
83
201
|
def test_regular_conjugation_with_terminal_e
|
84
|
-
assert_equal 'created',
|
85
|
-
|
202
|
+
assert_equal 'created',
|
203
|
+
Verbs::Conjugator.conjugate(:create, tense: :past, person: :first, plurality: :singular,
|
204
|
+
aspect: :perfective)
|
205
|
+
assert_equal 'was hiding',
|
206
|
+
Verbs::Conjugator.conjugate(:hide, tense: :past, person: :first, plurality: :singular,
|
207
|
+
aspect: :progressive)
|
86
208
|
end
|
209
|
+
|
210
|
+
def test_regular_conjugation_with_terminal_c
|
211
|
+
assert_equal 'mimicked', Verbs::Conjugator.conjugate(:mimic, tense: :past, aspect: :perfective)
|
212
|
+
assert_equal 'was mimicking', Verbs::Conjugator.conjugate(:mimic, tense: :past, person: :first, plurality: :singular,
|
213
|
+
aspect: :progressive)
|
214
|
+
assert_equal 'panicked', Verbs::Conjugator.conjugate(:panic, tense: :past, aspect: :perfective)
|
215
|
+
assert_equal 'was panicking', Verbs::Conjugator.conjugate(:panic, tense: :past, person: :first, plurality: :singular,
|
216
|
+
aspect: :progressive)
|
217
|
+
end
|
218
|
+
|
87
219
|
def test_regular_conjugation_with_unusual_terminal_e
|
88
|
-
assert_equal 'dyed',
|
89
|
-
|
90
|
-
|
91
|
-
assert_equal '
|
92
|
-
|
220
|
+
assert_equal 'dyed',
|
221
|
+
Verbs::Conjugator.conjugate(:dye, tense: :past, person: :first, plurality: :singular,
|
222
|
+
aspect: :perfective)
|
223
|
+
assert_equal 'hoed',
|
224
|
+
Verbs::Conjugator.conjugate(:hoe, tense: :past, person: :first, plurality: :singular,
|
225
|
+
aspect: :perfective)
|
226
|
+
assert_equal 'singed',
|
227
|
+
Verbs::Conjugator.conjugate(:singe, tense: :past, person: :first, plurality: :singular,
|
228
|
+
aspect: :perfective)
|
229
|
+
assert_equal 'tied',
|
230
|
+
Verbs::Conjugator.conjugate(:tie, tense: :past, person: :first, plurality: :singular,
|
231
|
+
aspect: :perfective)
|
232
|
+
assert_equal 'agreed',
|
233
|
+
Verbs::Conjugator.conjugate(:agree, tense: :past, person: :first, plurality: :singular,
|
234
|
+
aspect: :perfective)
|
235
|
+
assert_equal 'is tying', Verbs::Conjugator.conjugate(:tie, plurality: :singular, aspect: :progressive)
|
236
|
+
assert_equal 'was tying', Verbs::Conjugator.conjugate(:tie, tense: :past, plurality: :singular, aspect: :progressive)
|
237
|
+
assert_equal 'issued',
|
238
|
+
Verbs::Conjugator.conjugate(:issue, tense: :past, person: :first, plurality: :singular, aspect: :perfective)
|
239
|
+
assert_equal 'was issuing', Verbs::Conjugator.conjugate(:issue, tense: :past, plurality: :singular, aspect: :progressive)
|
93
240
|
end
|
241
|
+
|
94
242
|
def test_conjugation_with_terminal_sibilance
|
95
|
-
assert_equal 'passes',
|
96
|
-
|
97
|
-
|
98
|
-
assert_equal '
|
99
|
-
|
100
|
-
|
243
|
+
assert_equal 'passes',
|
244
|
+
Verbs::Conjugator.conjugate(:pass, tense: :present, person: :third, plurality: :singular,
|
245
|
+
aspect: :habitual)
|
246
|
+
assert_equal 'focusses',
|
247
|
+
Verbs::Conjugator.conjugate(:focus, tense: :present, person: :third, plurality: :singular,
|
248
|
+
aspect: :habitual)
|
249
|
+
assert_equal 'buzzes',
|
250
|
+
Verbs::Conjugator.conjugate(:buzz, tense: :present, person: :third, plurality: :singular,
|
251
|
+
aspect: :habitual)
|
252
|
+
assert_equal 'coaxes',
|
253
|
+
Verbs::Conjugator.conjugate(:coax, tense: :present, person: :third, plurality: :singular,
|
254
|
+
aspect: :habitual)
|
255
|
+
assert_equal 'washes',
|
256
|
+
Verbs::Conjugator.conjugate(:wash, tense: :present, person: :third, plurality: :singular,
|
257
|
+
aspect: :habitual)
|
258
|
+
assert_equal 'watches',
|
259
|
+
Verbs::Conjugator.conjugate(:watch, tense: :present, person: :third, plurality: :singular,
|
260
|
+
aspect: :habitual)
|
101
261
|
end
|
262
|
+
|
102
263
|
def test_conjugation_with_subject
|
103
|
-
assert_equal 'Matz is',
|
104
|
-
|
264
|
+
assert_equal 'Matz is',
|
265
|
+
Verbs::Conjugator.conjugate(:be, tense: :present, person: :third, plurality: :singular, subject: 'Matz',
|
266
|
+
aspect: :habitual)
|
267
|
+
assert_equal 'We are',
|
268
|
+
Verbs::Conjugator.conjugate(:be, tense: :present, person: :first, plurality: :plural, subject: true,
|
269
|
+
aspect: :habitual)
|
105
270
|
end
|
271
|
+
|
106
272
|
def test_conjugation_with_false_subject
|
107
|
-
assert_equal 'accepts', Verbs::Conjugator.conjugate(:accept, :
|
273
|
+
assert_equal 'accepts', Verbs::Conjugator.conjugate(:accept, subject: false)
|
108
274
|
end
|
275
|
+
|
109
276
|
def test_core_access
|
110
|
-
assert_equal :accepts,
|
111
|
-
|
277
|
+
assert_equal :accepts,
|
278
|
+
:accept.verb.conjugate(tense: :present, person: :third, plurality: :singular, aspect: :habitual)
|
279
|
+
assert_equal 'accepts',
|
280
|
+
'accept'.verb.conjugate(tense: :present, person: :third, plurality: :singular, aspect: :habitual)
|
281
|
+
assert_equal 'Girl is Near', 'Be Near'.verb.conjugate(subject: 'Girl')
|
112
282
|
end
|
283
|
+
|
113
284
|
def test_aspects
|
114
|
-
Verbs::Conjugator.with_options :
|
115
|
-
assert_equal 'I used to accept',
|
116
|
-
assert_equal 'I had accepted', standard.conjugate(:accept, :
|
117
|
-
assert_equal 'I accepted', standard.conjugate(:accept, :
|
118
|
-
assert_equal 'I was accepting', standard.conjugate(:accept, :
|
119
|
-
assert_equal 'I was about to accept', standard.conjugate(:accept, :
|
120
|
-
assert_equal 'I accept', standard.conjugate(:accept, :
|
121
|
-
assert_equal 'I have accepted', standard.conjugate(:accept, :
|
122
|
-
assert_equal 'I am having accepted', standard.conjugate(:accept, :
|
123
|
-
assert_equal 'I am accepting', standard.conjugate(:accept, :
|
124
|
-
assert_equal 'I am about to accept', standard.conjugate(:accept, :
|
125
|
-
assert_equal 'I will accept', standard.conjugate(:accept, :
|
126
|
-
assert_equal 'I will have accepted', standard.conjugate(:accept, :
|
127
|
-
assert_equal 'I will be having accepted', standard.conjugate(:accept, :
|
128
|
-
assert_equal 'I will be accepting', standard.conjugate(:accept, :
|
129
|
-
assert_equal 'I will be about to accept', standard.conjugate(:accept, :
|
285
|
+
Verbs::Conjugator.with_options person: :first, plurality: :singular, subject: true do |standard|
|
286
|
+
assert_equal 'I used to accept', standard.conjugate(:accept, tense: :past, aspect: :habitual)
|
287
|
+
assert_equal 'I had accepted', standard.conjugate(:accept, tense: :past, aspect: :perfect)
|
288
|
+
assert_equal 'I accepted', standard.conjugate(:accept, tense: :past, aspect: :perfective)
|
289
|
+
assert_equal 'I was accepting', standard.conjugate(:accept, tense: :past, aspect: :progressive)
|
290
|
+
assert_equal 'I was about to accept', standard.conjugate(:accept, tense: :past, aspect: :prospective)
|
291
|
+
assert_equal 'I accept', standard.conjugate(:accept, tense: :present, aspect: :habitual)
|
292
|
+
assert_equal 'I have accepted', standard.conjugate(:accept, tense: :present, aspect: :perfect)
|
293
|
+
assert_equal 'I am having accepted', standard.conjugate(:accept, tense: :present, aspect: :perfective)
|
294
|
+
assert_equal 'I am accepting', standard.conjugate(:accept, tense: :present, aspect: :progressive)
|
295
|
+
assert_equal 'I am about to accept', standard.conjugate(:accept, tense: :present, aspect: :prospective)
|
296
|
+
assert_equal 'I will accept', standard.conjugate(:accept, tense: :future, aspect: :habitual)
|
297
|
+
assert_equal 'I will have accepted', standard.conjugate(:accept, tense: :future, aspect: :perfect)
|
298
|
+
assert_equal 'I will be having accepted', standard.conjugate(:accept, tense: :future, aspect: :perfective)
|
299
|
+
assert_equal 'I will be accepting', standard.conjugate(:accept, tense: :future, aspect: :progressive)
|
300
|
+
assert_equal 'I will be about to accept', standard.conjugate(:accept, tense: :future, aspect: :prospective)
|
130
301
|
end
|
131
302
|
end
|
303
|
+
|
132
304
|
def test_mood
|
133
|
-
assert_equal Verbs::Conjugator.conjugate(:accept, :
|
134
|
-
|
135
|
-
assert_equal '
|
136
|
-
assert_equal '
|
137
|
-
assert_equal '
|
305
|
+
assert_equal Verbs::Conjugator.conjugate(:accept, person: :third),
|
306
|
+
Verbs::Conjugator.conjugate(:accept, person: :third, mood: :indicative)
|
307
|
+
assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, person: :third, mood: :subjunctive)
|
308
|
+
assert_equal 'be', Verbs::Conjugator.conjugate(:be, mood: :subjunctive, tense: :present)
|
309
|
+
assert_equal 'were',
|
310
|
+
Verbs::Conjugator.conjugate(:be, mood: :subjunctive, tense: :past, aspect: :perfective)
|
311
|
+
assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, person: :second, mood: :imperative)
|
138
312
|
end
|
313
|
+
|
139
314
|
def test_improper_construction
|
140
315
|
assert_raise Verbs::ImproperConstruction do
|
141
|
-
Verbs::Conjugator.conjugate(:accept, :
|
316
|
+
Verbs::Conjugator.conjugate(:accept, mood: :imperative)
|
142
317
|
end
|
143
318
|
end
|
144
319
|
|
145
320
|
def test_s_forms
|
146
|
-
Verbs::Conjugator.with_options :
|
321
|
+
Verbs::Conjugator.with_options person: :third, tense: :present do |standard|
|
147
322
|
assert_equal 'does', standard.conjugate('do')
|
148
323
|
assert_equal 'flies', standard.conjugate('fly')
|
149
324
|
assert_equal 'assesses', standard.conjugate('assess')
|
@@ -162,16 +337,84 @@ class TestVerbs < Test::Unit::TestCase
|
|
162
337
|
|
163
338
|
def test_immutability
|
164
339
|
verb = 'like'
|
165
|
-
Verbs::Conjugator.conjugate(verb, :
|
340
|
+
Verbs::Conjugator.conjugate(verb, tense: :past, aspect: :perfective)
|
166
341
|
assert_equal 'like', verb
|
167
342
|
end
|
168
343
|
|
169
344
|
def test_second_person_plural_forms
|
170
|
-
Verbs::Conjugator.with_options :
|
171
|
-
assert_equal 'You had accepted', standard.conjugate(:accept, :
|
172
|
-
assert_equal 'You accepted', standard.conjugate(:accept, :
|
173
|
-
assert_equal 'You were accepting', standard.conjugate(:accept, :
|
174
|
-
assert_equal 'You were about to accept', standard.conjugate(:accept, :
|
345
|
+
Verbs::Conjugator.with_options person: :second, plurality: :plural, subject: true do |standard|
|
346
|
+
assert_equal 'You had accepted', standard.conjugate(:accept, tense: :past, aspect: :perfect)
|
347
|
+
assert_equal 'You accepted', standard.conjugate(:accept, tense: :past, aspect: :perfective)
|
348
|
+
assert_equal 'You were accepting', standard.conjugate(:accept, tense: :past, aspect: :progressive)
|
349
|
+
assert_equal 'You were about to accept', standard.conjugate(:accept, tense: :past, aspect: :prospective)
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
def test_passive
|
354
|
+
Verbs::Conjugator.with_options diathesis: :passive, person: :first, plurality: :singular,
|
355
|
+
subject: true do |standard|
|
356
|
+
assert_equal 'I used to be accepted', standard.conjugate(:accept, tense: :past, aspect: :habitual)
|
357
|
+
assert_equal 'I had been accepted', standard.conjugate(:accept, tense: :past, aspect: :perfect)
|
358
|
+
assert_equal 'I was accepted',
|
359
|
+
standard.conjugate(:accept, tense: :past, aspect: :perfective)
|
360
|
+
assert_equal 'I was being accepted',
|
361
|
+
standard.conjugate(:accept, tense: :past, aspect: :progressive)
|
362
|
+
assert_equal 'I was about to be accepted',
|
363
|
+
standard.conjugate(:accept, tense: :past, aspect: :prospective)
|
364
|
+
assert_equal 'I am accepted',
|
365
|
+
standard.conjugate(:accept, tense: :present, aspect: :habitual)
|
366
|
+
assert_equal 'I have been accepted',
|
367
|
+
standard.conjugate(:accept, tense: :present, aspect: :perfect)
|
368
|
+
assert_equal 'I am being accepted',
|
369
|
+
standard.conjugate(:accept, tense: :present, aspect: :progressive)
|
370
|
+
assert_equal 'I am about to be accepted',
|
371
|
+
standard.conjugate(:accept, tense: :present, aspect: :prospective)
|
372
|
+
assert_equal 'I will be accepted',
|
373
|
+
standard.conjugate(:accept, tense: :future, aspect: :habitual)
|
374
|
+
assert_equal 'I will have been accepted', standard.conjugate(:accept, tense: :future, aspect: :perfect)
|
375
|
+
assert_equal 'I will be being accepted',
|
376
|
+
standard.conjugate(:accept, tense: :future, aspect: :progressive)
|
377
|
+
assert_equal 'I will be about to be accepted',
|
378
|
+
standard.conjugate(:accept, tense: :future, aspect: :prospective)
|
379
|
+
end
|
380
|
+
|
381
|
+
Verbs::Conjugator.with_options diathesis: :passive, person: :third, plurality: :plural,
|
382
|
+
subject: true do |standard|
|
383
|
+
assert_equal 'They used to be accepted',
|
384
|
+
standard.conjugate(:accept, tense: :past, aspect: :habitual)
|
385
|
+
assert_equal 'They had been accepted',
|
386
|
+
standard.conjugate(:accept, tense: :past, aspect: :perfect)
|
387
|
+
assert_equal 'They were accepted',
|
388
|
+
standard.conjugate(:accept, tense: :past, aspect: :perfective)
|
389
|
+
assert_equal 'They were being accepted',
|
390
|
+
standard.conjugate(:accept, tense: :past, aspect: :progressive)
|
391
|
+
assert_equal 'They were about to be accepted',
|
392
|
+
standard.conjugate(:accept, tense: :past, aspect: :prospective)
|
393
|
+
assert_equal 'They are accepted',
|
394
|
+
standard.conjugate(:accept, tense: :present, aspect: :habitual)
|
395
|
+
assert_equal 'They have been accepted',
|
396
|
+
standard.conjugate(:accept, tense: :present, aspect: :perfect)
|
397
|
+
assert_equal 'They are being accepted',
|
398
|
+
standard.conjugate(:accept, tense: :present, aspect: :progressive)
|
399
|
+
assert_equal 'They are about to be accepted',
|
400
|
+
standard.conjugate(:accept, tense: :present, aspect: :prospective)
|
401
|
+
assert_equal 'They will be accepted',
|
402
|
+
standard.conjugate(:accept, tense: :future, aspect: :habitual)
|
403
|
+
assert_equal 'They will have been accepted',
|
404
|
+
standard.conjugate(:accept, tense: :future, aspect: :perfect)
|
405
|
+
assert_equal 'They will be being accepted',
|
406
|
+
standard.conjugate(:accept, tense: :future, aspect: :progressive)
|
407
|
+
assert_equal 'They will be about to be accepted',
|
408
|
+
standard.conjugate(:accept, tense: :future, aspect: :prospective)
|
409
|
+
end
|
410
|
+
|
411
|
+
assert_raise Verbs::ImproperConstruction do
|
412
|
+
Verbs::Conjugator.conjugate(:be, diathesis: :passive)
|
175
413
|
end
|
176
414
|
end
|
415
|
+
|
416
|
+
def test_not_modifying_frozen_string
|
417
|
+
assert_equal 'is mimicking', Verbs::Conjugator.conjugate(:mimic, aspect: :progressive)
|
418
|
+
assert_equal 'was mimicking', Verbs::Conjugator.conjugate(:mimic, tense: :past, aspect: :progressive)
|
419
|
+
end
|
177
420
|
end
|