Changed Mon_Ouie's test to use :exception_handler hash param instead

of the accessor. Modified `ls -av` to `ls -avf` so as to prevent
pageer from activating and failing test.
This commit is contained in:
John Mair 2011-04-18 16:48:35 +12:00
parent 080d19e2fe
commit 21a6cc66d4
1 changed files with 7 additions and 9 deletions

View File

@ -88,11 +88,10 @@ describe Pry do
o = Exception.new
str_output = StringIO.new
pry_tester = Pry.new(:input => InputTester.new("self"),
:output => str_output)
was_called = false
pry_tester.exception_handler = proc { was_called = true }
pry_tester = Pry.new(:input => InputTester.new("self"),
:output => str_output,
:exception_handler => proc { was_called = true })
pry_tester.rep(o)
was_called.should == false
@ -102,11 +101,10 @@ describe Pry do
o = Exception.new
str_output = StringIO.new
pry_tester = Pry.new(:input => InputTester.new("raise self"),
:output => str_output)
was_called = false
pry_tester.exception_handler = proc { was_called = true }
pry_tester = Pry.new(:input => InputTester.new("raise self"),
:output => str_output,
:exception_handler => proc { was_called = true })
pry_tester.rep(o)
was_called.should == true
@ -405,7 +403,7 @@ describe Pry do
it "should execute command and show output with :show_output => true flag" do
str = StringIO.new
Pry.output = str
result = Pry.run_command "ls -av", :context => RCTest, :show_output => true
result = Pry.run_command "ls -afv", :context => RCTest, :show_output => true
str.string.should =~ /global variables/
Pry.output = $stdout
end