@@ -16,7 +16,7 @@ def run_spec_test(test_case, options = {})
16
16
17
17
if test_case . overwrite?
18
18
overwrite_test! ( test_case )
19
- return
19
+ return true
20
20
end
21
21
22
22
return unless handle_missing_output! ( test_case )
@@ -30,6 +30,8 @@ def run_spec_test(test_case, options = {})
30
30
return unless handle_expected_error_message! ( test_case , options )
31
31
return unless handle_unexpected_error_message! ( test_case , options )
32
32
end
33
+
34
+ return true
33
35
end
34
36
35
37
# if the test case is interactive it will do the interaction and return
@@ -51,6 +53,7 @@ def handle_expected_error_message!(test_case, options)
51
53
expected_error_msg = _extract_error_message ( test_case . expected_error , options )
52
54
53
55
if expected_error_msg != error_msg
56
+ return false if test_case . probe_todo?
54
57
interact ( test_case , :fail ) do |i |
55
58
i . prompt ( error_msg . nil? ? "An error message was expected but wasn't produced." :
56
59
"Error output doesn't match what was expected." )
@@ -106,13 +109,14 @@ def handle_expected_error_message!(test_case, options)
106
109
107
110
def handle_unexpected_error_message! ( test_case , options )
108
111
return true if test_case . verify_stderr?
109
-
112
+
110
113
_output , _clean_output , error , _status = test_case . output
111
114
112
115
error_msg = _extract_error_message ( error , options )
113
116
114
117
return true if error_msg . nil? || error_msg . length == 0
115
118
119
+ return false if test_case . probe_todo?
116
120
interact ( test_case , :fail ) do |i |
117
121
i . prompt "Unexpected output to stderr"
118
122
@@ -160,6 +164,7 @@ def handle_output_difference!(test_case, options)
160
164
return false
161
165
end
162
166
167
+ return false if test_case . probe_todo?
163
168
interact ( test_case , :fail ) do |i |
164
169
i . prompt "output does not match expectation"
165
170
@@ -201,6 +206,7 @@ def handle_missing_output!(test_case)
201
206
return true if File . exists? ( test_case . expected_path )
202
207
203
208
output , _ , error , _ = test_case . output
209
+ return false if test_case . probe_todo?
204
210
choice = interact ( test_case , :fail ) do |i |
205
211
i . prompt "in #{ test_case . name } \n " +
206
212
"Expected output file does not exist."
@@ -253,6 +259,7 @@ def handle_unexpected_pass!(test_case, options)
253
259
return false
254
260
end
255
261
262
+ return false if test_case . probe_todo?
256
263
choice = interact ( test_case , :fail ) do |i |
257
264
i . prompt "In #{ test_case . name } \n " +
258
265
"A failure was expected but it compiled instead."
@@ -302,6 +309,7 @@ def handle_unexpected_error!(test_case, options)
302
309
return false
303
310
end
304
311
312
+ return false if test_case . probe_todo?
305
313
choice = interact ( test_case , :fail ) do |i |
306
314
i . prompt "In #{ test_case . name } \n " +
307
315
"An unexpected compiler error was encountered."
@@ -401,7 +409,7 @@ def migrate_test!(test_case, options)
401
409
end
402
410
403
411
start_version_index = SassSpec ::LANGUAGE_VERSIONS . index (
404
- test_case . metadata . start_version . to_s )
412
+ test_case . metadata . start_version . to_s )
405
413
406
414
if start_version_index >= current_version_index
407
415
puts "Cannot migrate test. Test does not apply to an earlier version."
@@ -548,7 +556,7 @@ class SassSpec::Test < Minitest::Test
548
556
def self . create_tests ( test_cases , options = { } )
549
557
test_cases [ 0 ..options [ :limit ] ] . each do |test_case |
550
558
define_method ( "test__#{ test_case . name } " ) do
551
- run_spec_test ( test_case , options )
559
+ test_case . finalize ( run_spec_test ( test_case , options ) )
552
560
end
553
561
end
554
562
end
0 commit comments