Class: Fruity::Runner

Inherits:
Struct
  • Object
show all
Defined in:
lib/fruity/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#baselinesObject (readonly)

Returns the value of attribute baselines.



3
4
5
# File 'lib/fruity/runner.rb', line 3

def baselines
  @baselines
end

#delayObject (readonly)

Returns the value of attribute delay.



3
4
5
# File 'lib/fruity/runner.rb', line 3

def delay
  @delay
end

#groupObject

Returns the value of attribute group

Returns:

  • (Object)

    the current value of group



2
3
4
# File 'lib/fruity/runner.rb', line 2

def group
  @group
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/fruity/runner.rb', line 3

def options
  @options
end

#timingsObject (readonly)

Returns the value of attribute timings.



3
4
5
# File 'lib/fruity/runner.rb', line 3

def timings
  @timings
end

Instance Method Details

#feedbackObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fruity/runner.rb', line 11

def feedback
  mess = "Running each test " << (options[:magnify] == 1 ? "once." : "#{options[:magnify]} times.")
  if d = delay
    if d > 60
      d = (d / 60).round
      unit = "minute"
    end
    mess << " Test will take about #{d.ceil} #{unit || 'second'}#{d > 1 ? 's' : ''}."
  end
  puts mess
end

#run(options = {}) {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



5
6
7
8
9
# File 'lib/fruity/runner.rb', line 5

def run(options = {})
  prepare(options)
  yield self if block_given?
  sample
end