Class: Rocksteady::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/rocksteady/session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(corpus) ⇒ Session

Returns a new instance of Session.



6
7
8
# File 'lib/rocksteady/session.rb', line 6

def initialize(corpus)
  @corpus = corpus
end

Instance Attribute Details

#corpusObject (readonly)

Returns the value of attribute corpus.



5
6
7
# File 'lib/rocksteady/session.rb', line 5

def corpus
  @corpus
end

Instance Method Details

#run! {|corpus.schedule| ... } ⇒ Object

Yields:



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rocksteady/session.rb', line 18

def run!
  return if corpus.schedule.empty?
  create_timestamp_directory
  clone_repos
  corpus.schedule.each do |scenario|
    focus_on scenario do
      scenario.run!
    end
  end
  yield corpus.schedule
end

#timestampObject



14
15
16
# File 'lib/rocksteady/session.rb', line 14

def timestamp
  @timestamp ||= Time.now.to_i
end

#titleObject



10
11
12
# File 'lib/rocksteady/session.rb', line 10

def title
  @title ||= corpus.refs.map { |k, v| "#{k} `#{v}'" }.join(' vs ')
end