Class: WIP::Runner::Spec::Helpers::UIHelpers::Simulator

Inherits:
Object
  • Object
show all
Defined in:
lib/wip/runner/spec/helpers/ui_helpers.rb

Overview

adapted from gist.github.com/194554

Instance Method Summary collapse

Constructor Details

#initialize(values, all = false) ⇒ Simulator

Returns a new instance of Simulator.



78
79
80
81
# File 'lib/wip/runner/spec/helpers/ui_helpers.rb', line 78

def initialize(values, all = false)
  @values = values.map { |s| s.nil? ? '' : s }
  @all    = all
end

Instance Method Details

#eof?Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/wip/runner/spec/helpers/ui_helpers.rb', line 87

def eof?
  false
end

#getsObject



83
84
85
# File 'lib/wip/runner/spec/helpers/ui_helpers.rb', line 83

def gets
  @all ? @values.first : @values.shift
end