Skip to content

Commit

Permalink
Add basic test for Slop.parse
Browse files Browse the repository at this point in the history
See #251
  • Loading branch information
leejarvis committed Jan 28, 2020
1 parent c5e0af0 commit 0a44dfe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/slop_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
require "test_helper"

describe Slop do
describe ".parse" do
it "parses a list of arguments" do
result = Slop.parse(%w[--name Lee]) do |o|
o.string "--name"
end

assert_equal "Lee", result[:name]
end
end

describe ".option_defined?" do
it "handles bad constant names" do
assert_equal false, Slop.option_defined?("Foo?Bar")
Expand Down

0 comments on commit 0a44dfe

Please sign in to comment.