Sha256: ab7856fd4e3ab78a55c979b5cfe60c9e5d1e38df316532ab5d1a14a8c48fcb29
Contents?: true
Size: 523 Bytes
Versions: 87
Compression:
Stored size: 523 Bytes
Contents
class MockInput #----------------------------------------------------------------------------- # Constructor / Destructor def initialize(strings) if strings.is_a?(String) strings = [ strings ] end @strings = strings end #--- def self.with(strings) $stdin = self.new(strings) yield ensure $stdin = STDIN end #----------------------------------------------------------------------------- # Accessors / Modifiers def gets return @strings.shift end end
Version data entries
87 entries across 87 versions & 3 rubygems