Add naive cli command router
This commit is contained in:
14
spec/command_router_spec.cr
Normal file
14
spec/command_router_spec.cr
Normal file
@ -0,0 +1,14 @@
|
||||
require "./spec_helper"
|
||||
require "../src/cli/*"
|
||||
|
||||
describe CLI::CommandRouter do
|
||||
it "should handle simple command" do
|
||||
router = CLI::CommandRouter.new
|
||||
x = 10
|
||||
router.add "plus" do
|
||||
x += 5
|
||||
end
|
||||
router.handle "plus"
|
||||
x.should eq 15
|
||||
end
|
||||
end
|
1
spec/resources_spec.cr
Normal file
1
spec/resources_spec.cr
Normal file
@ -0,0 +1 @@
|
||||
require "./spec_helper"
|
Reference in New Issue
Block a user