@@ -123,13 +123,6 @@ def test_help_default
123
123
end
124
124
125
125
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
133
126
stdin = $stdin
134
127
$stdin = StringIO . new ( "1+1" )
135
128
@@ -140,17 +133,13 @@ def test_no_arguments_no_tty
140
133
end
141
134
142
135
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 )
147
138
end
148
139
149
140
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 )
154
143
end
155
144
156
145
def test_generic_error
@@ -251,10 +240,8 @@ def run_cli(command, *args, contents: :default)
251
240
252
241
status = nil
253
242
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 ] )
258
245
end
259
246
260
247
Result . new ( status : status , stdio : stdio , stderr : stderr )
@@ -263,10 +250,6 @@ def run_cli(command, *args, contents: :default)
263
250
tempfile . unlink
264
251
end
265
252
266
- def with_tty ( &block )
267
- $stdin. stub ( :tty? , true , &block )
268
- end
269
-
270
253
def with_config_file ( contents )
271
254
filepath = File . join ( Dir . pwd , SyntaxTree ::CLI ::ConfigFile ::FILENAME )
272
255
File . write ( filepath , contents )
0 commit comments