Class: WIP::Runner::Spec::Helpers::IOHelpers::CustomHighLine

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

Instance Method Summary collapse

Instance Method Details

#ask(question, answer_type = String, &block) ⇒ Object

Strips the same-line indicating, trailing space from questions in order to print the newline in specs (that would come from user input).



48
49
50
# File 'lib/wip/runner/spec/helpers/io_helpers.rb', line 48

def ask(question, answer_type = String, &block)
  super("#{question.rstrip}", answer_type, &block)
end

#color(string, *colors) ⇒ Object

Strips formatting for specs.



59
60
61
# File 'lib/wip/runner/spec/helpers/io_helpers.rb', line 59

def color(string, *colors)
  string
end

#say(statement) ⇒ Object

Strips double spaces between question and default.



53
54
55
56
# File 'lib/wip/runner/spec/helpers/io_helpers.rb', line 53

def say(statement)
  # puts statement.to_s.inspect
  super statement.to_s.gsub(/:\s{2,}\|/, ': |')
end