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.
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :release do
4
+ desc 'generate changelog'
5
+ task :generate_changelog do |_task, _args|
6
+ `github_changelog_generator -u rossmeissl -p verbs`
7
+ end
8
+ end
data/test/helper.rb CHANGED
@@ -1,9 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'test/unit'
3
5
 
4
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
5
7
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
8
  require 'verbs'
7
-
8
- class Test::Unit::TestCase
9
- end
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', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :singular, :aspect => :habitual)
7
- assert_equal 'are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :second, :plurality => :singular, :aspect => :habitual)
8
- assert_equal 'is', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
9
- assert_equal 'are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :plural, :aspect => :habitual)
10
- assert_equal 'are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :plural, :aspect => :habitual)
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', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :singular, :aspect => :habitual)
14
- assert_equal 'used to be', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :second, :plurality => :singular, :aspect => :habitual)
15
- assert_equal 'used to be', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :singular, :aspect => :habitual)
16
- assert_equal 'used to be', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :plural, :aspect => :habitual)
17
- assert_equal 'used to be', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :plural, :aspect => :habitual)
18
-
19
- assert_equal 'was', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
20
- assert_equal 'were', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :second, :plurality => :singular, :aspect => :perfective)
21
- assert_equal 'was', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
22
- assert_equal 'were', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :first, :plurality => :plural, :aspect => :perfective)
23
- assert_equal 'were', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :plurality => :plural, :aspect => :perfective)
24
-
25
- assert_equal 'was being', Verbs::Conjugator.conjugate(:be, :tense => :past, :person => :third, :aspect => :progressive)
26
- assert_equal 'is being', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :aspect => :progressive)
27
- assert_equal 'will be being', Verbs::Conjugator.conjugate(:be, :tense => :future, :person => :third, :aspect => :progressive)
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', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :first, :plurality => :singular, :aspect => :habitual)
31
- assert_equal 'break', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :second, :plurality => :singular, :aspect => :habitual)
32
- assert_equal 'breaks', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
33
- assert_equal 'break', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :first, :plurality => :plural, :aspect => :habitual)
34
- assert_equal 'break', Verbs::Conjugator.conjugate(:break, :tense => :present, :person => :third, :plurality => :plural, :aspect => :habitual)
35
- assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
36
- assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
37
- assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
38
- assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
39
- assert_equal 'broke', Verbs::Conjugator.conjugate(:break, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
40
- assert_equal 'has', Verbs::Conjugator.conjugate(:have, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
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 'had known', Verbs::Conjugator.conjugate(:know, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfect)
44
- assert_equal 'knew', Verbs::Conjugator.conjugate(:know, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
45
- assert_equal 'was knowing', Verbs::Conjugator.conjugate(:know, :tense => :past, :person => :third, :plurality => :singular, :aspect => :progressive)
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', Verbs::Conjugator.conjugate(:fly, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
49
- assert_equal 'carried', Verbs::Conjugator.conjugate(:carry, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
50
- assert_equal 'stayed', Verbs::Conjugator.conjugate(:stay, :tense => :past, :person => :third, :plurality => :singular, :aspect => :perfective)
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', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :first, :plurality => :singular, :aspect => :habitual)
54
- assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :second, :plurality => :singular, :aspect => :habitual)
55
- assert_equal 'accepts', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
56
- assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :first, :plurality => :plural, :aspect => :habitual)
57
- assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, :tense => :present, :person => :third, :plurality => :plural, :aspect => :habitual)
58
- assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
59
- assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
60
- assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
61
- assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
62
- assert_equal 'accepted', Verbs::Conjugator.conjugate(:accept, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
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', Verbs::Conjugator.conjugate(:ship, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
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', Verbs::Conjugator.conjugate(:abandon, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
69
- assert_equal 'followed', Verbs::Conjugator.conjugate(:follow, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
70
- assert_equal 'triggered', Verbs::Conjugator.conjugate(:trigger, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
71
- assert_equal 'colored', Verbs::Conjugator.conjugate(:color, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
72
- assert_equal 'delivered', Verbs::Conjugator.conjugate(:deliver, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
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', Verbs::Conjugator.conjugate(:clean, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
76
- assert_equal 'am cleaning', Verbs::Conjugator.conjugate(:clean, :tense => :present, :person => :first, :plurality => :singular, :aspect => :progressive)
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', Verbs::Conjugator.conjugate(:fix, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
80
- assert_equal 'fixed', Verbs::Conjugator.conjugate(:fix, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
81
- assert_equal 'faxed', Verbs::Conjugator.conjugate(:fax, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
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', Verbs::Conjugator.conjugate(:create, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
85
- assert_equal 'was hiding', Verbs::Conjugator.conjugate(:hide, :tense => :past, :person => :first, :plurality => :singular, :aspect => :progressive)
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', Verbs::Conjugator.conjugate(:dye, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
89
- assert_equal 'hoed', Verbs::Conjugator.conjugate(:hoe, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
90
- assert_equal 'singed', Verbs::Conjugator.conjugate(:singe, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
91
- assert_equal 'tied', Verbs::Conjugator.conjugate(:tie, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
92
- assert_equal 'agreed', Verbs::Conjugator.conjugate(:agree, :tense => :past, :person => :first, :plurality => :singular, :aspect => :perfective)
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', Verbs::Conjugator.conjugate(:pass, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
96
- assert_equal 'focusses', Verbs::Conjugator.conjugate(:focus, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
97
- assert_equal 'buzzes', Verbs::Conjugator.conjugate(:buzz, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
98
- assert_equal 'coaxes', Verbs::Conjugator.conjugate(:coax, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
99
- assert_equal 'washes', Verbs::Conjugator.conjugate(:wash, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
100
- assert_equal 'watches', Verbs::Conjugator.conjugate(:watch, :tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
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', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :third, :plurality => :singular, :subject => 'Matz', :aspect => :habitual)
104
- assert_equal 'We are', Verbs::Conjugator.conjugate(:be, :tense => :present, :person => :first, :plurality => :plural, :subject => true, :aspect => :habitual)
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, :subject => false)
273
+ assert_equal 'accepts', Verbs::Conjugator.conjugate(:accept, subject: false)
108
274
  end
275
+
109
276
  def test_core_access
110
- assert_equal :accepts, :accept.verb.conjugate(:tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
111
- assert_equal 'accepts', 'accept'.verb.conjugate(:tense => :present, :person => :third, :plurality => :singular, :aspect => :habitual)
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 :person => :first, :plurality => :singular, :subject => true do |standard|
115
- assert_equal 'I used to accept', standard.conjugate(:accept, :tense => :past, :aspect => :habitual)
116
- assert_equal 'I had accepted', standard.conjugate(:accept, :tense => :past, :aspect => :perfect)
117
- assert_equal 'I accepted', standard.conjugate(:accept, :tense => :past, :aspect => :perfective)
118
- assert_equal 'I was accepting', standard.conjugate(:accept, :tense => :past, :aspect => :progressive)
119
- assert_equal 'I was about to accept', standard.conjugate(:accept, :tense => :past, :aspect => :prospective)
120
- assert_equal 'I accept', standard.conjugate(:accept, :tense => :present, :aspect => :habitual)
121
- assert_equal 'I have accepted', standard.conjugate(:accept, :tense => :present, :aspect => :perfect)
122
- assert_equal 'I am having accepted', standard.conjugate(:accept, :tense => :present, :aspect => :perfective)
123
- assert_equal 'I am accepting', standard.conjugate(:accept, :tense => :present, :aspect => :progressive)
124
- assert_equal 'I am about to accept', standard.conjugate(:accept, :tense => :present, :aspect => :prospective)
125
- assert_equal 'I will accept', standard.conjugate(:accept, :tense => :future, :aspect => :habitual)
126
- assert_equal 'I will have accepted', standard.conjugate(:accept, :tense => :future, :aspect => :perfect)
127
- assert_equal 'I will be having accepted', standard.conjugate(:accept, :tense => :future, :aspect => :perfective)
128
- assert_equal 'I will be accepting', standard.conjugate(:accept, :tense => :future, :aspect => :progressive)
129
- assert_equal 'I will be about to accept', standard.conjugate(:accept, :tense => :future, :aspect => :prospective)
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, :person => :third), Verbs::Conjugator.conjugate(:accept, :person => :third, :mood => :indicative)
134
- assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, :person => :third, :mood => :subjunctive)
135
- assert_equal 'be', Verbs::Conjugator.conjugate(:be, :mood => :subjunctive, :tense => :present)
136
- assert_equal 'were', Verbs::Conjugator.conjugate(:be, :mood => :subjunctive, :tense => :past, :aspect => :perfective)
137
- assert_equal 'accept', Verbs::Conjugator.conjugate(:accept, :person => :second, :mood => :imperative)
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, :mood => :imperative)
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 :person => :third, :tense => :present do |standard|
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, :tense => :past, :aspect => :perfective)
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 :person => :second, :plurality => :plural, :subject => true do |standard|
171
- assert_equal 'You had accepted', standard.conjugate(:accept, :tense => :past, :aspect => :perfect)
172
- assert_equal 'You accepted', standard.conjugate(:accept, :tense => :past, :aspect => :perfective)
173
- assert_equal 'You were accepting', standard.conjugate(:accept, :tense => :past, :aspect => :progressive)
174
- assert_equal 'You were about to accept', standard.conjugate(:accept, :tense => :past, :aspect => :prospective)
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