Class: AreWeThereYet::Recorder

Inherits:
Spec::Runner::Formatter::BaseFormatter
  • Object
show all
Defined in:
lib/are_we_there_yet/recorder.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, where) ⇒ Recorder

Returns a new instance of Recorder.



3
4
5
6
7
8
9
# File 'lib/are_we_there_yet/recorder.rb', line 3

def initialize(options,where)
  @db = AreWeThereYet::Persistence::Connection.create(where)

  AreWeThereYet::Persistence::Schema.create(@db)

  log_run
end

Instance Method Details

#closeObject



19
20
21
22
# File 'lib/are_we_there_yet/recorder.rb', line 19

def close
  @run.finish(@db)
  @db.disconnect
end

#example_passed(example) ⇒ Object



15
16
17
# File 'lib/are_we_there_yet/recorder.rb', line 15

def example_passed(example)
  persist_metric(example)
end

#example_started(example) ⇒ Object



11
12
13
# File 'lib/are_we_there_yet/recorder.rb', line 11

def example_started(example)
  @start = Time.now
end