Skip to content

Commit 6c15fd3

Browse files
committed
fixed tests for new default value of exact_match (true)
1 parent 657bf8b commit 6c15fd3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/optimist/parser_test.rb

+4-5
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def test_default_shorts_assigned_only_after_user_shorts
11781178
end
11791179

11801180
def test_inexact_match
1181-
newp = Parser.new()
1181+
newp = Parser.new(exact_match: false)
11821182
newp.opt :liberation, "liberate something", :type => :int
11831183
newp.opt :evaluate, "evaluate something", :type => :string
11841184
opts = newp.parse %w(--lib 5 --ev bar)
@@ -1188,7 +1188,7 @@ def test_inexact_match
11881188
end
11891189

11901190
def test_exact_match
1191-
newp = Parser.new(exact_match: true)
1191+
newp = Parser.new()
11921192
newp.opt :liberation, "liberate something", :type => :int
11931193
newp.opt :evaluate, "evaluate something", :type => :string
11941194
assert_raises(CommandlineError, /unknown argument '--lib'/) do
@@ -1200,7 +1200,7 @@ def test_exact_match
12001200
end
12011201

12021202
def test_inexact_collision
1203-
newp = Parser.new()
1203+
newp = Parser.new(exact_match: false)
12041204
newp.opt :bookname, "name of a book", :type => :string
12051205
newp.opt :bookcost, "cost of the book", :type => :string
12061206
opts = newp.parse %w(--bookn hairy_potsworth --bookc 10)
@@ -1216,13 +1216,12 @@ def test_inexact_collision
12161216
end
12171217

12181218
def test_inexact_collision_with_exact
1219-
newp = Parser.new()
1219+
newp = Parser.new(exact_match: false)
12201220
newp.opt :book, "name of a book", :type => :string, :default => "ABC"
12211221
newp.opt :bookcost, "cost of the book", :type => :int, :default => 5
12221222
opts = newp.parse %w(--book warthog --bookc 3)
12231223
assert_equal 'warthog', opts[:book]
12241224
assert_equal 3, opts[:bookcost]
1225-
12261225
end
12271226

12281227
def test_accepts_arguments_with_spaces

0 commit comments

Comments
 (0)