mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
37 lines
516 B
Ruby
37 lines
516 B
Ruby
class Object
|
|
def test_method
|
|
end
|
|
end
|
|
|
|
class InputTester
|
|
def initialize(*actions)
|
|
@orig_actions = actions.dup
|
|
@actions = actions
|
|
end
|
|
|
|
def read(*)
|
|
@actions.shift
|
|
end
|
|
|
|
def rewind
|
|
@actions = @orig_actions
|
|
end
|
|
end
|
|
|
|
class OutputTester
|
|
attr_reader :output_buffer
|
|
|
|
def initialize
|
|
@output_buffer = ""
|
|
end
|
|
|
|
def print(val)
|
|
@output_buffer = val
|
|
end
|
|
|
|
def method_missing(meth_name, *args, &block)
|
|
define_singleton_method("#{meth_name}_invoked") { true }
|
|
end
|
|
end
|
|
|
|
|