File tree 2 files changed +46
-0
lines changed
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 17
17
require "rails_spec_helper"
18
18
require "mocha/minitest"
19
19
20
+ require "debug/prelude"
21
+
20
22
backtrace_filter = Minitest ::ExtensibleBacktraceFilter . default_filter
21
23
backtrace_filter . add_filter ( %r{gems/sorbet-runtime} )
22
24
backtrace_filter . add_filter ( %r{gems/railties} )
Original file line number Diff line number Diff line change
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ require "spec_helper"
5
+
6
+ module Tapioca
7
+ module Loaders
8
+ class DslSpec < SpecWithProject
9
+ describe "#load_application" do
10
+ it "loads the application if `lsp_addon` is false" do
11
+ outputs = capture_io do
12
+ Loaders ::Dsl . load_application (
13
+ tapioca_path : @project . absolute_path ,
14
+ app_root : @project . absolute_path ,
15
+ lsp_addon : false ,
16
+ )
17
+ end
18
+
19
+ output = outputs . first # TODO: why are there two outputs?
20
+
21
+ assert_match ( /Loading DSL extension classes.../ , output )
22
+ assert_match ( /Loading Rails application/ , output )
23
+ assert_match ( /Loading DSL compiler classes.../ , output )
24
+ end
25
+
26
+ it "does not load the application if `lsp_addon` is true" do
27
+ outputs = capture_io do
28
+ Loaders ::Dsl . load_application (
29
+ tapioca_path : @project . absolute_path ,
30
+ app_root : @project . absolute_path ,
31
+ lsp_addon : true ,
32
+ )
33
+ end
34
+
35
+ output = outputs . first # TODO: why are there two outputs?
36
+
37
+ assert_match ( /Loading DSL extension classes.../ , output )
38
+ refute_match ( /Loading Rails application/ , output )
39
+ assert_match ( /Loading DSL compiler classes.../ , output )
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
You can’t perform that action at this time.
0 commit comments