From fd2e366c2e4478fc32f6392e27eea275fc86333c Mon Sep 17 00:00:00 2001 From: strcmp Date: Mon, 24 Aug 2015 03:01:56 +0100 Subject: [PATCH] add testcase for #1464 --- spec/pry_output_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/pry_output_spec.rb b/spec/pry_output_spec.rb index aba6a196..9430dc8d 100644 --- a/spec/pry_output_spec.rb +++ b/spec/pry_output_spec.rb @@ -112,4 +112,14 @@ describe Pry do expect(mock_pry("# basic addition")).to eq("") end end + + describe "custom non-IO object as $stdout" do + it "does not crash pry" do + old_stdout = $stdout + custom_io = Class.new { def write(*) end }.new + pry_eval = PryTester.new(binding) + expect(pry_eval.eval("$stdout = custom_io", ":ok")).to eq(:ok) + $stdout = old_stdout + end + end end