Add naive cli command router

This commit is contained in:
Anton Vakhrushev
2019-10-03 17:48:59 +03:00
parent e4035008b8
commit 1f494c5a63
3 changed files with 32 additions and 0 deletions

View 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
View File

@ -0,0 +1 @@
require "./spec_helper"