Skip to content

Commit dd9aaad

Browse files
committed
Add test for lsp_addon flag in CLI
1 parent c5544f7 commit dd9aaad

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

spec/a_spec.rb

-12
This file was deleted.

spec/tapioca/cli_spec.rb

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# typed: true
2+
# frozen_string_literal: true
3+
4+
require "spec_helper"
5+
6+
module Tapioca
7+
class CliSpec < SpecWithProject
8+
describe "Tapioca::Cli" do
9+
before do
10+
@command_stub = mock(run: nil)
11+
end
12+
13+
it "passes through the `lsp_addon` flag to the DslGenerate command" do
14+
Commands::DslGenerate.expects(:new).with do |options|
15+
options[:lsp_addon] == true
16+
end.returns(@command_stub)
17+
18+
capture_io { Cli.start(["dsl", "--lsp_addon"]) }
19+
end
20+
21+
it "does not pass through the `lsp_addon` flag to the DslGenerate command if not present" do
22+
Commands::DslGenerate.expects(:new).with do |options|
23+
options[:lsp_addon].nil?
24+
end.returns(@command_stub)
25+
26+
capture_io { Cli.start(["dsl", "--another-flag"]) }
27+
end
28+
end
29+
end
30+
end

0 commit comments

Comments
 (0)