Module: BrowserShooter::Logger

Extended by:
Logger
Included in:
Logger
Defined in:
lib/browser_shooter/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#verboseObject

Returns the value of attribute verbose.



5
6
7
# File 'lib/browser_shooter/logger.rb', line 5

def verbose
  @verbose
end

Instance Method Details

#command_result(command_result) ⇒ Object



13
14
15
16
# File 'lib/browser_shooter/logger.rb', line 13

def command_result( command_result )
  Kernel.print "." if command_result[:success]
  Kernel.print "F" if !command_result[:success]
end

#log(message, force = verbose) ⇒ Object



7
8
9
10
11
# File 'lib/browser_shooter/logger.rb', line 7

def log( message, force = verbose )
  if force
    Kernel.puts "[BrowserShooter #{Time.now.strftime( "%F %T" )}] #{message}"
  end
end

#test_result(test_result) ⇒ Object



18
19
20
21
# File 'lib/browser_shooter/logger.rb', line 18

def test_result( test_result )
  Kernel.puts " (success)" if test_result.all? { |e| e[:success] }
  Kernel.puts " (fail)"    if !test_result.all? { |e| e[:success] }
end