-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# typed: true | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
module Tapioca | ||
module Loaders | ||
class DslSpec < SpecWithProject | ||
describe "#load_application" do | ||
it "loads the application if `lsp_addon` is false" do | ||
outputs = capture_io do | ||
Loaders::Dsl.load_application( | ||
tapioca_path: @project.absolute_path, | ||
app_root: @project.absolute_path, | ||
lsp_addon: false, | ||
) | ||
end | ||
|
||
output = outputs.first # TODO: why are there two outputs? | ||
|
||
assert_match(/Loading DSL extension classes.../, output) | ||
assert_match(/Loading Rails application/, output) | ||
assert_match(/Loading DSL compiler classes.../, output) | ||
end | ||
|
||
it "does not load the application if `lsp_addon` is true" do | ||
outputs = capture_io do | ||
Loaders::Dsl.load_application( | ||
tapioca_path: @project.absolute_path, | ||
app_root: @project.absolute_path, | ||
lsp_addon: true, | ||
) | ||
end | ||
|
||
output = outputs.first # TODO: why are there two outputs? | ||
|
||
assert_match(/Loading DSL extension classes.../, output) | ||
refute_match(/Loading Rails application/, output) | ||
assert_match(/Loading DSL compiler classes.../, output) | ||
end | ||
end | ||
end | ||
end | ||
end |