From 7b2b4d6031b2a39cbda6028a114540c67c4bf65d Mon Sep 17 00:00:00 2001 From: John Mair Date: Tue, 24 Jan 2012 21:43:20 +1300 Subject: [PATCH] made = nil for tests --- test/helper.rb | 5 +++++ test/test_default_commands/test_documentation.rb | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) 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