pry--pry/test/test_helper.rb

33 lines
550 B
Ruby
Raw Normal View History

class Object
def test_method
end
end
class InputTester
def initialize(*actions)
@orig_actions = actions.dup
@actions = actions
end
2011-01-09 11:51:45 +00:00
def readline(*)
@actions.shift
end
def rewind
@actions = @orig_actions.dup
end
end
class CommandTester
def commands
@commands ||= {
2011-01-05 22:07:06 +00:00
"command1" => proc { |opts| opts[:output].puts "command1"; opts[:val].clear },
/command2\s*(.*)/ => proc do |opts|
arg = opts[:captures].first
opts[:output].puts arg
2011-01-05 22:07:06 +00:00
opts[:val].clear
end
}
end
end