Class: BladeRunner::TestResults::Pass

Inherits:
Object
  • Object
show all
Defined in:
lib/blade_runner/test_results.rb

Direct Known Subclasses

Failure

Instance Method Summary collapse

Constructor Details

#initialize(name, message) ⇒ Pass

Returns a new instance of Pass.



70
71
72
73
# File 'lib/blade_runner/test_results.rb', line 70

def initialize(name, message)
  @name = name
  @message = message
end

Instance Method Details

#messageObject



79
80
81
82
83
# File 'lib/blade_runner/test_results.rb', line 79

def message
  unless @message.nil?
    "\n" + @message.gsub(/^/, "# ").chomp
  end
end

#to_s(number = nil) ⇒ Object



75
76
77
# File 'lib/blade_runner/test_results.rb', line 75

def to_s(number = nil)
  ["ok", number, @name, message].compact.join(" ")
end