Skip to content

Commit 1714546

Browse files
authored
1 parent f6f63c8 commit 1714546

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# frozen_string_literal: true
2+
3+
require "test_helper"
4+
5+
require "skunk/command_factory"
6+
require "skunk/commands/default"
7+
require "skunk/commands/version"
8+
9+
describe Skunk::CommandFactory do
10+
describe ".command_class" do
11+
context "when mode does not exist" do
12+
it "returns the default command" do
13+
command = Skunk::CommandFactory.command_class(:foo)
14+
15+
_(command).must_equal Skunk::Command::Default
16+
end
17+
end
18+
19+
context "when mode exists" do
20+
it "returns the version command" do
21+
command = Skunk::CommandFactory.command_class(:version)
22+
23+
_(command).must_equal Skunk::Command::Version
24+
end
25+
end
26+
end
27+
end

0 commit comments

Comments
 (0)