From b9117c86193e240a2800f3c9bb44f15bcd43fe79 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Fri, 28 Dec 2012 14:12:19 -0800 Subject: [PATCH] Tidier test for BasicObject support --- spec/helpers/repl_tester.rb | 1 + spec/pry_spec.rb | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/spec/helpers/repl_tester.rb b/spec/helpers/repl_tester.rb index 4159e26b..c6fc80ce 100644 --- a/spec/helpers/repl_tester.rb +++ b/spec/helpers/repl_tester.rb @@ -67,6 +67,7 @@ class ReplTester reset_output repl_mailbox.push input wait + Pry.output.string end # Assert that the current prompt matches the given string or regex. diff --git a/spec/pry_spec.rb b/spec/pry_spec.rb index de194057..0acd3f7f 100644 --- a/spec/pry_spec.rb +++ b/spec/pry_spec.rb @@ -10,11 +10,9 @@ describe Pry do # regression test for exotic object support it "Should not error when return value is a BasicObject instance" do - lambda do - redirect_pry_io(InputTester.new("BasicObject.new", "exit-all"), StringIO.new) do - Pry.start - end - end.should.not.raise NoMethodError + ReplTester.start do + input('BasicObject.new').should =~ /^=> #