lib/cukeforker/runner.rb in cukeforker-0.1.2 vs lib/cukeforker/runner.rb in cukeforker-0.1.3
- old
+ new
@@ -4,29 +4,31 @@
# Runner.run(features, opts)
#
# where 'features' is an Array of file:line
# and 'opts' is a Hash of options:
#
- # :max => Fixnum number of workers (default: 2)
- # :vnc => true/false children are launched with DISPLAY set from a VNC server pool,
- # where the size of the pool is equal to :max
- # :record => true/false whether to record a video of failed tests (requires ffmpeg)
- # this will be ignored if if :vnc is not true
- # :notify => object (or array of objects) implementing the AbstractListener API
- # :out => path directory to dump output to (default: current working dir)
- # :log => true/false wether or not to log to stdout (default: true)
- # :format => Symbol format passed to `cucumber --format` (default: html)
- # :extra_args => Array extra arguments passed to cucumber
+ # :max => Fixnum number of workers (default: 2)
+ # :vnc => true/false children are launched with DISPLAY set from a VNC server pool,
+ # where the size of the pool is equal to :max
+ # :record => true/false,Hash whether to record a video of failed tests (requires ffmpeg)
+ # this will be ignored if if :vnc is not true. If passed a Hash,
+ # these will be passed as options to RecordingVncListener
+ # :notify => object (or array of objects) implementing the AbstractListener API
+ # :out => path directory to dump output to (default: current working dir)
+ # :log => true/false wether or not to log to stdout (default: true)
+ # :format => Symbol format passed to `cucumber --format` (default: html)
+ # :extra_args => Array extra arguments passed to cucumber
#
class Runner
include Observable
DEFAULT_OPTIONS = {
:max => 2,
:vnc => false,
- :notify => [],
+ :record => false,
+ :notify => nil,
:out => Dir.pwd,
:log => true,
:format => :html
}
@@ -49,11 +51,15 @@
if opts[:vnc]
vnc_pool = VncTools::ServerPool.new(max)
listener = VncListener.new(vnc_pool)
- if opts[:record]
- listeners << RecordingVncListener.new(listener)
+ if record = opts[:record]
+ if record.kind_of?(Hash)
+ listeners << RecordingVncListener.new(listener, record)
+ else
+ listeners << RecordingVncListener.new(listener)
+ end
end
end
queue = WorkerQueue.new max
features.each do |feature|