lib/testlab/utility/misc.rb in testlab-0.3.0 vs lib/testlab/utility/misc.rb in testlab-0.3.1
- old
+ new
@@ -4,11 +4,11 @@
# Misc Error Class
class MiscError < UtilityError; end
# Misc Module
#
- # @author Zachary Patten <zachary@jovelabs.net>
+ # @author Zachary Patten <zachary AT jovelabs DOT com>
module Misc
def format_object(object, color)
klass = object.class.to_s.split('::').last
@@ -34,10 +34,11 @@
ui.nil? and raise MiscError, "You must supply a ZTK::UI object!"
message.nil? and raise MiscError, "You must supply a message!"
message = format_message(message)
length = message.uncolor.length
- mark = ((' ' * (60 - length)) + mark)
+ max = (length >= 60 ? (length+1) : (60 - length))
+ mark = ((' ' * max) + mark)
ZTK::Benchmark.bench(:ui => ui, :message => message, :mark => mark) do
yield
end
end