class Rspeckled::Reporting::Example
Constants
- ExecutionResult
- IGNORED_QUERIES_PATTERN
Attributes
counts[RW]
example[RW]
Public Class Methods
new(example)
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 31 def initialize(example) self.counts = Hash.new(0) self.example = example end
Public Instance Methods
description()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 52 def description metadata[:full_description] end
exception()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 56 def exception execution_result.exception end
file()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 36 def file metadata[:file_path] end
line_number()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 40 def line_number metadata[:line_number] end
log_query(query, start, finish)
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 76 def log_query(query, start, finish) return if IGNORED_QUERIES_PATTERN.match?(query[:sql]) counts[:query_count] += 1 counts[:query_time] += (finish - start) end
log_request(_request, start, finish)
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 83 def log_request(_request, start, finish) counts[:request_count] += 1 counts[:request_time] += (finish - start) end
query_count()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 60 def query_count counts[:query_count] end
query_time()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 64 def query_time counts[:query_time] end
request_count()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 68 def request_count counts[:request_count] end
request_time()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 72 def request_time counts[:request_time] end
status()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 44 def status execution_result.status end
time()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 48 def time execution_result.run_time end
Private Instance Methods
execution_result()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 94 def execution_result @execution_result ||= if example.execution_result.is_a?(::Hash) ExecutionResult.new(example.execution_result) else example.execution_result end end
metadata()
click to toggle source
# File lib/rspeckled/reporting/example.rb, line 90 def metadata example.metadata end