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 f665339
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
12 changes: 0 additions & 12 deletions spec/a_spec.rb

This file was deleted.

32 changes: 32 additions & 0 deletions spec/tapioca/cli_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# typed: true
# frozen_string_literal: true

require "spec_helper"

module Tapioca
class CliSpec < SpecWithProject
describe "Tapioca::Cli" do
before do
@command_stub = stub
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)
@command_stub.expects(:run)

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

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

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

0 comments on commit f665339

Please sign in to comment.