cukeforker 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
@@ -3,10 +3,23 @@ cukeforker
3
3
 
4
4
  Forking cukes and VNC displays.
5
5
 
6
+ [![Build Status](https://secure.travis-ci.org/jarib/cukeforker.png)](http://travis-ci.org/jarib/cukeforker)
7
+
6
8
  Usage
7
9
  =============
8
-
9
- TODO.
10
+ ```ruby
11
+ # parallelize per feature
12
+ CukeForker::Runner.run Dir['features/**/*.feature'],
13
+ :max => 4 # number of workers
14
+ :out => "/path/to/reports", # output path
15
+ :format => :html # passed to `cucumber --format`,
16
+ :extra_args => %w[--extra arguments] # passed to cucumber,
17
+ :vnc => true # manage a pool of VNC displays, assign one per worker.
18
+
19
+ # parallelize per scenario, with one JUnit XML file per scenario.
20
+ CukeForker::Runner.run CukeForker::Scenarios.tagged(%W[@edition ~@wip])
21
+ :extra_args => %W[-f CukeForker::Formatters::JunitScenarioFormatter --out results/junit]
22
+ ```
10
23
 
11
24
  Note on Patches/Pull Requests
12
25
  =============================
@@ -6,17 +6,18 @@ module CukeForker
6
6
  # where 'features' is an Array of file:line
7
7
  # and 'opts' is a Hash of options:
8
8
  #
9
- # :max => Fixnum number of workers (default: 2)
10
- # :vnc => true/false children are launched with DISPLAY set from a VNC server pool,
11
- # where the size of the pool is equal to :max
12
- # :record => true/false,Hash whether to record a video of failed tests (requires ffmpeg)
13
- # this will be ignored if if :vnc is not true. If passed a Hash,
14
- # these will be passed as options to RecordingVncListener
15
- # :notify => object (or array of objects) implementing the AbstractListener API
16
- # :out => path directory to dump output to (default: current working dir)
17
- # :log => true/false wether or not to log to stdout (default: true)
18
- # :format => Symbol format passed to `cucumber --format` (default: html)
19
- # :extra_args => Array extra arguments passed to cucumber
9
+ # :max => Fixnum number of workers (default: 2)
10
+ # :vnc => true/false,Class children are launched with DISPLAY set from a VNC server pool,
11
+ # where the size of the pool is equal to :max. If passed a Class instance,
12
+ # this will be passed as the second argument to VncTools::ServerPool.
13
+ # :record => true/false,Hash whether to record a video of failed tests (requires ffmpeg)
14
+ # this will be ignored if if :vnc is not true. If passed a Hash,
15
+ # this will be passed as options to RecordingVncListener
16
+ # :notify => object (or array of objects) implementing the AbstractListener API
17
+ # :out => path directory to dump output to (default: current working dir)
18
+ # :log => true/false wether or not to log to stdout (default: true)
19
+ # :format => Symbol format passed to `cucumber --format` (default: html)
20
+ # :extra_args => Array extra arguments passed to cucumber
20
21
  #
21
22
 
22
23
  class Runner
@@ -49,8 +50,13 @@ module CukeForker
49
50
  listeners << LoggingListener.new
50
51
  end
51
52
 
52
- if opts[:vnc]
53
- vnc_pool = VncTools::ServerPool.new(max)
53
+ if vnc = opts[:vnc]
54
+ if vnc.kind_of?(Class)
55
+ vnc_pool = VncTools::ServerPool.new(max, vnc)
56
+ else
57
+ vnc_pool = VncTools::ServerPool.new(max)
58
+ end
59
+
54
60
  listener = VncListener.new(vnc_pool)
55
61
 
56
62
  if record = opts[:record]
@@ -71,10 +77,10 @@ module CukeForker
71
77
 
72
78
  runner = Runner.new queue
73
79
 
74
- listeners.each { |listener|
75
- queue.add_observer listener
76
- runner.add_observer listener
77
- vnc_pool.add_observer listener if opts[:vnc]
80
+ listeners.each { |l|
81
+ queue.add_observer l
82
+ runner.add_observer l
83
+ vnc_pool.add_observer l if opts[:vnc]
78
84
  }
79
85
 
80
86
  runner
@@ -1,3 +1,3 @@
1
1
  module CukeForker
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -44,6 +44,16 @@ module CukeForker
44
44
  Runner.create([], :max => 2, :vnc => true)
45
45
  end
46
46
 
47
+ it "sets up the VNC pool with a custom server class" do
48
+ server_class = Class.new
49
+
50
+ mock_pool = mock(VncTools::ServerPool, :add_observer => nil)
51
+ VncTools::ServerPool.should_receive(:new).with(2, server_class).and_return mock_pool
52
+ VncListener.should_receive(:new).with(mock_pool).and_return mock(:update => nil)
53
+
54
+ Runner.create([], :max => 2, :vnc => server_class)
55
+ end
56
+
47
57
  it "sets up VNC recording if :record => true" do
48
58
  mock_pool = mock(VncTools::ServerPool, :add_observer => nil)
49
59
  VncTools::ServerPool.should_receive(:new).with(2).and_return mock_pool
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cukeforker
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jari Bakken
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-22 00:00:00 Z
18
+ date: 2011-11-10 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: cucumber
@@ -102,6 +102,7 @@ extra_rdoc_files: []
102
102
  files:
103
103
  - .gitignore
104
104
  - .rspec
105
+ - .travis.yml
105
106
  - Gemfile
106
107
  - LICENSE
107
108
  - README.mdown