Bug #18657 ยป ruby-irb.patch
lib/irb/input-method.rb | ||
---|---|---|
public :gets
|
||
def winsize
|
||
if instance_variable_defined?(:@stdout)
|
||
if instance_variable_defined?(:@stdout) && @stdout.tty?
|
||
@stdout.winsize
|
||
else
|
||
[24, 80]
|
test/irb/test_context.rb | ||
---|---|---|
def reset
|
||
@line_no = 0
|
||
end
|
||
def winsize
|
||
[10, 20]
|
||
end
|
||
end
|
||
def setup
|
||
... | ... | |
], out)
|
||
end
|
||
def test_output_to_pipe
|
||
input = TestInputMethod.new(["n=1"])
|
||
input.instance_variable_set(:@stdout, StringIO.new)
|
||
irb = IRB::Irb.new(IRB::WorkSpace.new(Object.new), input)
|
||
irb.context.echo_on_assignment = :truncate
|
||
out, err = capture_output do
|
||
irb.eval_input
|
||
end
|
||
assert_empty err
|
||
assert_equal "=> 1\n", out
|
||
end
|
||
def test_eval_object_without_inspect_method
|
||
verbose, $VERBOSE = $VERBOSE, nil
|
||
all_assertions do |all|
|