mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Add extra_options from CLI
This commit is contained in:
commit
20a174b66e
3 changed files with 20 additions and 1 deletions
|
@ -28,4 +28,19 @@ describe "Config" do
|
|||
config.add_handler CustomTestHandler.new
|
||||
config.handlers.size.should eq(5)
|
||||
end
|
||||
|
||||
it "adds custom options" do
|
||||
config = Kemal.config
|
||||
ARGV.push("--test")
|
||||
ARGV.push("FOOBAR")
|
||||
test_option = nil
|
||||
|
||||
config.extra_options do |parser|
|
||||
parser.on("--test TEST_OPTION", "Test an option") do |opt|
|
||||
test_option = opt
|
||||
end
|
||||
end
|
||||
Kemal::CLI.new
|
||||
test_option.should eq("FOOBAR")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue