@@ -1178,7 +1178,7 @@ def test_default_shorts_assigned_only_after_user_shorts
1178
1178
end
1179
1179
1180
1180
def test_inexact_match
1181
- newp = Parser . new ( )
1181
+ newp = Parser . new ( exact_match : false )
1182
1182
newp . opt :liberation , "liberate something" , :type => :int
1183
1183
newp . opt :evaluate , "evaluate something" , :type => :string
1184
1184
opts = newp . parse %w( --lib 5 --ev bar )
@@ -1188,7 +1188,7 @@ def test_inexact_match
1188
1188
end
1189
1189
1190
1190
def test_exact_match
1191
- newp = Parser . new ( exact_match : true )
1191
+ newp = Parser . new ( )
1192
1192
newp . opt :liberation , "liberate something" , :type => :int
1193
1193
newp . opt :evaluate , "evaluate something" , :type => :string
1194
1194
assert_raises ( CommandlineError , /unknown argument '--lib'/ ) do
@@ -1200,7 +1200,7 @@ def test_exact_match
1200
1200
end
1201
1201
1202
1202
def test_inexact_collision
1203
- newp = Parser . new ( )
1203
+ newp = Parser . new ( exact_match : false )
1204
1204
newp . opt :bookname , "name of a book" , :type => :string
1205
1205
newp . opt :bookcost , "cost of the book" , :type => :string
1206
1206
opts = newp . parse %w( --bookn hairy_potsworth --bookc 10 )
@@ -1216,13 +1216,12 @@ def test_inexact_collision
1216
1216
end
1217
1217
1218
1218
def test_inexact_collision_with_exact
1219
- newp = Parser . new ( )
1219
+ newp = Parser . new ( exact_match : false )
1220
1220
newp . opt :book , "name of a book" , :type => :string , :default => "ABC"
1221
1221
newp . opt :bookcost , "cost of the book" , :type => :int , :default => 5
1222
1222
opts = newp . parse %w( --book warthog --bookc 3 )
1223
1223
assert_equal 'warthog' , opts [ :book ]
1224
1224
assert_equal 3 , opts [ :bookcost ]
1225
-
1226
1225
end
1227
1226
1228
1227
def test_accepts_arguments_with_spaces
0 commit comments