spec/spec_helper_source.rb
# Method stubs $stdin not STDIN !
Method stubs $stdin not STDIN !
Method stubs $stdin not STDIN !
def provide_stdin(input, tty = false, &block)
  orig_stdin = $stdin
  $stdin = StringIO.new(input)
  $stdin.send(:define_singleton_method, :tty?){ tty }  
  yield
ensure
  $stdin = orig_stdin
end
def provide_stdin ( input , tty = false , & block ) orig_stdin = $stdin $stdin = StringIO . new ( input ) $stdin . send ( :define_singleton_method , :tty? ) { tty } yield ensure $stdin = orig_stdin end
Method stubs $stdin not STDIN !
Method stubs $stdin not STDIN !
# Simulate that stdin is tty by default
input
<not_specific>
tty
<not_specific>
block
<not_specific>