Class: Fruity::Runner
- Inherits:
-
Struct
- Object
- Struct
- Fruity::Runner
- Defined in:
- lib/fruity/runner.rb
Instance Attribute Summary collapse
-
#baselines ⇒ Object
readonly
Returns the value of attribute baselines.
-
#delay ⇒ Object
readonly
Returns the value of attribute delay.
-
#group ⇒ Object
Returns the value of attribute group.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#timings ⇒ Object
readonly
Returns the value of attribute timings.
Instance Method Summary collapse
Instance Attribute Details
#baselines ⇒ Object (readonly)
Returns the value of attribute baselines.
3 4 5 |
# File 'lib/fruity/runner.rb', line 3 def baselines @baselines end |
#delay ⇒ Object (readonly)
Returns the value of attribute delay.
3 4 5 |
# File 'lib/fruity/runner.rb', line 3 def delay @delay end |
#group ⇒ Object
Returns the value of attribute group
2 3 4 |
# File 'lib/fruity/runner.rb', line 2 def group @group end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/fruity/runner.rb', line 3 def @options end |
#timings ⇒ Object (readonly)
Returns the value of attribute timings.
3 4 5 |
# File 'lib/fruity/runner.rb', line 3 def timings @timings end |
Instance Method Details
#feedback ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fruity/runner.rb', line 11 def feedback mess = "Running each test " << ([:magnify] == 1 ? "once." : "#{[: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
5 6 7 8 9 |
# File 'lib/fruity/runner.rb', line 5 def run( = {}) prepare() yield self if block_given? sample end |