Skip to content

Commit

Permalink
Add test for lsp_addon flag in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Nov 28, 2024
1 parent c5544f7 commit 2a81a56
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/tapioca/cli_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# typed: true
# frozen_string_literal: true

require "spec_helper"

module Tapioca
class CliSpec < SpecWithProject
before do
@command_stub = stub(run: nil)
end

it "passes through the `lsp_addon` flag to the DslGenerate command" do
Commands::DslGenerate.expects(:new).with do |options|
options[:lsp_addon] == true
end.returns(@command_stub)

capture_io { Cli.start(["dsl", "--lsp_addon"]) }.join
end

it "does not through the `lsp_addon` flag to the DslGenerate command when not present" do
Commands::DslGenerate.expects(:new).with do |options|
options[:lsp_addon].nil?
end.returns(@command_stub)

capture_io { Cli.start(["dsl", "--another-flag"]) }.join
end
end
end

0 comments on commit 2a81a56

Please sign in to comment.