test/show_test.rb in byebug-1.0.2 vs test/show_test.rb in byebug-1.0.3
- old
+ new
@@ -2,37 +2,31 @@
describe "Show Command" do
include TestDsl
describe "annotate" do
- temporary_change_method_value(Byebug, :annotate, nil)
-
it "must show annotate setting" do
enter 'show annotate'
debug_file 'show'
+ Byebug.annotate.must_equal 0
check_output_includes "Annotation level is 0"
end
-
- it "must show annotate setting" do
- enter 'show annotate'
- debug_file 'show'
- Byebug.annotate.must_equal 0
- end
end
describe "args" do
- temporary_change_hash_value(Byebug::Command.settings, :argv, %w{foo bar})
+ before do
+ Byebug::Command.settings[:argv] = %w{foo bar}
+ end
it "must show args" do
- Byebug.send(:remove_const, "RDEBUG_SCRIPT") if Byebug.const_defined?("RDEBUG_SCRIPT")
enter 'show args'
debug_file 'show'
check_output_includes 'Argument list to give program being debugged when it is started is "foo bar".'
end
- it "must not show the first arg if RDEBUG_SCRIPT is defined" do
- temporary_set_const(Byebug, "RDEBUG_SCRIPT", "bla") do
+ it "must not show the first arg if BYEBUG_SCRIPT is defined" do
+ temporary_set_const(Byebug, "BYEBUG_SCRIPT", "bla") do
enter 'show args'
debug_file 'show'
check_output_includes 'Argument list to give program being debugged when it is started is "bar".'
end
end
@@ -131,11 +125,11 @@
it "must show listsize" do
temporary_change_hash_value(Byebug::Command.settings, :listsize, 10) do
enter 'show listsize'
debug_file 'show'
- check_output_includes 'Number of source lines to list by default is 10.'
+ check_output_includes 'Number of source lines to list is 10.'
end
end
it "must show port" do
temporary_set_const(Byebug, "PORT", 12345) do
@@ -274,16 +268,14 @@
end
end
end
describe "Post Mortem" do
- temporary_change_hash_value(Byebug::Command.settings, :autolist, 0)
-
it "must work in post-mortem mode" do
skip("No post morten mode for now")
enter 'cont', "show autolist"
debug_file 'post_mortem'
- check_output_includes "autolist is off."
+ check_output_includes "autolist is on."
end
end
end