File tree Expand file tree Collapse file tree 3 files changed +44
-4
lines changed
Expand file tree Collapse file tree 3 files changed +44
-4
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,9 @@ def copy
6767 sig { returns ( String ) }
6868 def options_string
6969 opts = [ ]
70- opts . concat ( paths )
71- opts . concat ( ignore . map { |p | "--ignore #{ p } " } )
72- opts . concat ( allowed_extensions . map { |ext | "--allowed-extension #{ ext } " } )
70+ opts . concat ( paths . map { | p | "' #{ p } '" } )
71+ opts . concat ( ignore . map { |p | "--ignore ' #{ p } ' " } )
72+ opts . concat ( allowed_extensions . map { |ext | "--allowed-extension ' #{ ext } ' " } )
7373 opts << "--no-stdlib" if @no_stdlib
7474 opts . join ( " " )
7575 end
Original file line number Diff line number Diff line change @@ -488,6 +488,41 @@ def test_finish_on_original_branch
488488 assert_equal ( "fake-branch" , @project . git_current_branch )
489489 end
490490
491+ def test_config_options_string
492+ # Add ignore path to config to test config options string
493+ @project . write! ( "sorbet/config" , "\n --ignore=lib/a.rb\n --ignore=*.rb" , append : true )
494+
495+ result = @project . spoom ( "srb coverage snapshot" )
496+ out = censor_sorbet_version ( result . out )
497+ assert_equal ( <<~MSG , out )
498+ Sorbet static: X.X.XXXX
499+ Sorbet runtime: X.X.XXXX
500+
501+ Content:
502+ files: 3
503+ files excluding rbis: 2
504+ modules: 3
505+ classes: 1
506+ methods: 9
507+ methods excluding rbis: 9
508+
509+ Sigils:
510+ true: 3 (100%)
511+
512+ Methods:
513+ with signature: 2 (22%)
514+ without signature: 7 (78%)
515+
516+ Methods excluding RBIs
517+ with signature: 2 (22%)
518+ without signature: 7 (78%)
519+
520+ Calls:
521+ typed: 4 (67%)
522+ untyped: 2 (33%)
523+ MSG
524+ end
525+
491526 private
492527
493528 def create_git_history!
Original file line number Diff line number Diff line change @@ -207,7 +207,12 @@ def test_options_string_with_options
207207 --allowed-extension=.rb
208208 --no-stdlib
209209 CONFIG
210- assert_equal ( ". --ignore .git/ --ignore vendor/ --allowed-extension .rb --no-stdlib" , config . options_string )
210+ expected = "'.' " \
211+ "--ignore '.git/' " \
212+ "--ignore 'vendor/' " \
213+ "--allowed-extension '.rb' " \
214+ "--no-stdlib"
215+ assert_equal ( expected , config . options_string )
211216 end
212217 end
213218 end
You can’t perform that action at this time.
0 commit comments