File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 79
79
err . full_message ( highlight : true ) . should !~ /unhandled exception/
80
80
err . full_message ( highlight : false ) . should !~ /unhandled exception/
81
81
end
82
+
83
+ it "adds escape sequences to highlight some strings if the message is not specified and :highlight option is specified" do
84
+ e = RuntimeError . new ( "" )
85
+
86
+ full_message = e . full_message ( highlight : true , order : :top ) . lines
87
+ full_message [ 0 ] . should . end_with? "\e [1;4munhandled exception\e [m\n "
88
+
89
+ full_message = e . full_message ( highlight : true , order : :bottom ) . lines
90
+ full_message [ 0 ] . should == "\e [1mTraceback\e [m (most recent call last):\n "
91
+ full_message [ -1 ] . should . end_with? "\e [1;4munhandled exception\e [m\n "
92
+
93
+ full_message = e . full_message ( highlight : false , order : :top ) . lines
94
+ full_message [ 0 ] . should . end_with? "unhandled exception\n "
95
+
96
+ full_message = e . full_message ( highlight : false , order : :bottom ) . lines
97
+ full_message [ 0 ] . should == "Traceback (most recent call last):\n "
98
+ full_message [ -1 ] . should . end_with? "unhandled exception\n "
99
+ end
82
100
end
83
101
84
102
describe "generic Error" do
You can’t perform that action at this time.
0 commit comments