File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,16 @@ def run_spec_test(test_case, options = {})
76
76
end
77
77
78
78
def _clean_debug_path ( error )
79
- error . sub ( /^.*?(input.scss:\d + DEBUG:)/ , '\1' )
79
+ pwd = Dir . pwd
80
+ url = pwd . gsub ( /\\ / , '\/' )
81
+ error . gsub ( /^.*?(input.scss:\d + DEBUG:)/ , '\1' )
82
+ . gsub ( /[ ]+/ , " " )
83
+ . gsub ( /#{ Regexp . quote ( url ) } \/ / , "/sass/sass-spec/" )
84
+ . gsub ( /#{ Regexp . quote ( pwd ) } \/ / , "/sass/sass-spec/" )
85
+ . gsub ( /(?:\/ todo_|_todo\/ )/ , "/" )
86
+ . gsub ( /\/ libsass\- [a-z]+\- test\/ / , "/" )
87
+ . gsub ( /\/ libsass\- [a-z]+\- issue/ , "/libsass-issue" )
88
+ . strip
80
89
end
81
90
82
91
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ def expected
84
84
end
85
85
86
86
def expected_error
87
- @expected_error = File . read ( @error_path , :encoding => "utf-8" )
87
+ @expected_error = _clean_error ( File . read ( @error_path , :encoding => "utf-8" ) )
88
88
end
89
89
90
90
def expected_status
@@ -116,4 +116,18 @@ def _clean_output(css)
116
116
. strip
117
117
end
118
118
119
+ def _clean_error ( err )
120
+ pwd = Dir . pwd
121
+ url = pwd . gsub ( /\\ / , '/' )
122
+ err = err . force_encoding ( 'iso-8859-1' ) . encode ( 'utf-8' )
123
+ err . gsub ( /^.*?(input.scss:\d + DEBUG:)/ , '\1' )
124
+ . gsub ( /[ ]+/ , " " )
125
+ . gsub ( /#{ Regexp . quote ( url ) } \/ / , "/sass/sass-spec/" )
126
+ . gsub ( /#{ Regexp . quote ( pwd ) } \/ / , "/sass/sass-spec/" )
127
+ . gsub ( /(?:\/ todo_|_todo\/ )/ , "/" )
128
+ . gsub ( /\/ libsass\- [a-z]+\- test\/ / , "/" )
129
+ . gsub ( /\/ libsass\- [a-z]+\- issue/ , "/libsass-issue" )
130
+ . strip
131
+ end
132
+
119
133
end
You can’t perform that action at this time.
0 commit comments