@@ -123,13 +123,6 @@ def test_help_default
123123 end
124124
125125 def test_no_arguments
126- with_tty do
127- *, stderr = capture_io { SyntaxTree ::CLI . run ( [ "check" ] ) }
128- assert_includes ( stderr , "stree help" )
129- end
130- end
131-
132- def test_no_arguments_no_tty
133126 stdin = $stdin
134127 $stdin = StringIO . new ( "1+1" )
135128
@@ -140,17 +133,13 @@ def test_no_arguments_no_tty
140133 end
141134
142135 def test_inline_script
143- with_tty do
144- stdio , = capture_io { SyntaxTree ::CLI . run ( %w[ format -e 1+1 ] ) }
145- assert_equal ( "1 + 1\n " , stdio )
146- end
136+ stdio , = capture_io { SyntaxTree ::CLI . run ( %w[ format -e 1+1 ] ) }
137+ assert_equal ( "1 + 1\n " , stdio )
147138 end
148139
149140 def test_multiple_inline_scripts
150- with_tty do
151- stdio , = capture_io { SyntaxTree ::CLI . run ( %w[ format -e 1+1 -e 2+2 ] ) }
152- assert_equal ( "1 + 1\n 2 + 2\n " , stdio )
153- end
141+ stdio , = capture_io { SyntaxTree ::CLI . run ( %w[ format -e 1+1 -e 2+2 ] ) }
142+ assert_equal ( "1 + 1\n 2 + 2\n " , stdio )
154143 end
155144
156145 def test_generic_error
@@ -251,10 +240,8 @@ def run_cli(command, *args, contents: :default)
251240
252241 status = nil
253242 stdio , stderr =
254- with_tty do
255- capture_io do
256- status = SyntaxTree ::CLI . run ( [ command , *args , tempfile . path ] )
257- end
243+ capture_io do
244+ status = SyntaxTree ::CLI . run ( [ command , *args , tempfile . path ] )
258245 end
259246
260247 Result . new ( status : status , stdio : stdio , stderr : stderr )
@@ -263,10 +250,6 @@ def run_cli(command, *args, contents: :default)
263250 tempfile . unlink
264251 end
265252
266- def with_tty ( &block )
267- $stdin. stub ( :tty? , true , &block )
268- end
269-
270253 def with_config_file ( contents )
271254 filepath = File . join ( Dir . pwd , SyntaxTree ::CLI ::ConfigFile ::FILENAME )
272255 File . write ( filepath , contents )
0 commit comments