test/eval_test.rb in byebug-2.0.0 vs test/eval_test.rb in byebug-2.1.0
- old
+ new
@@ -18,10 +18,16 @@
enter 'p 3 + 2'
debug_file 'eval'
check_output_includes '5'
end
+ it 'must work when inspect raises an exception' do
+ enter 'c 14', 'p @foo'
+ debug_file('eval') { $state.line.must_equal 14 }
+ check_output_includes 'RuntimeError Exception: Broken'
+ end
+
describe 'autoeval' do
it 'must be set by default' do
enter '[5,6,7].inject(&:+)'
debug_file 'eval'
check_output_includes '18'
@@ -41,10 +47,10 @@
temporary_change_hash Byebug.settings, :stack_trace_on_error, true
it 'must show a stack trace' do
enter 'eval 2 / 0'
debug_file 'eval'
- check_output_includes /\S+:\d+:in `eval':divided by 0/
+ check_output_includes /\s*from \S+:in \`eval\'/
check_output_doesnt_include 'ZeroDivisionError Exception: divided by 0'
end
end
describe 'when disabled' do