diff --git a/test/helper.rb b/test/helper.rb index 10aaa449..36833054 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -8,6 +8,11 @@ puts "Ruby v#{RUBY_VERSION} (#{defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"}), P require 'bacon' require 'open4' + +# turn warnings off (esp for Pry::Hooks which will generate warnings +# in tests) +$VERBOSE = nil + # Ensure we do not execute any rc files Pry::RC_FILES.clear diff --git a/test/test_default_commands/test_documentation.rb b/test/test_default_commands/test_documentation.rb index 32a19ae8..b36bd91e 100644 --- a/test/test_default_commands/test_documentation.rb +++ b/test/test_default_commands/test_documentation.rb @@ -10,6 +10,13 @@ describe "Pry::DefaultCommands::Documentation" do str_output.string.should =~ /sample doc/ end + it 'should output a method\'s documentation with line numbers' do + redirect_pry_io(InputTester.new("show-doc sample_method -l", "exit-all"), str_output=StringIO.new) do + pry + end + + str_output.string.should =~ /\d: sample doc/ + end it 'should output a method\'s documentation with line numbers (base one)' do redirect_pry_io(InputTester.new("show-doc sample_method -b", "exit-all"), str_output=StringIO.new) do @@ -19,14 +26,6 @@ describe "Pry::DefaultCommands::Documentation" do str_output.string.should =~ /1: sample doc/ end - it 'should output a method\'s documentation with line numbers (base one)' do - redirect_pry_io(InputTester.new("show-doc sample_method -l", "exit-all"), str_output=StringIO.new) do - pry - end - - str_output.string.should =~ /\d: sample doc/ - end - it 'should output a method\'s documentation if inside method without needing to use method name' do o = Object.new