cukeforker 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/bin/cukeforker +5 -1
- data/lib/cukeforker/rake_task.rb +43 -0
- data/lib/cukeforker/runner.rb +2 -0
- data/lib/cukeforker/version.rb +1 -1
- data/spec/cukeforker/rake_task_spec.rb +47 -0
- data/spec/cukeforker/runner_spec.rb +20 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78d586215f5f03a4e562c4b6f2242b5c2344472a
|
4
|
+
data.tar.gz: d069baca9ebfa3407a0c1cae3e228a88187c9f6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8e4e3e6120d1480015688cde65aaae0f4e25fb737f71cb0a9fab615095d88ef45b33d5dcb450727d60f3b57413755a80a29600fd687986c4a58a489416b3710
|
7
|
+
data.tar.gz: 0aa754f8b2c5cd510f4e72520df6bd1a6e8d2557887989159aef49becda1f4eb0cc97ff24ef1000f45e639574c150a4a6048109b8cf2fbaabedb3ea59b70c0d6
|
data/.travis.yml
CHANGED
data/bin/cukeforker
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/tasklib'
|
3
|
+
|
4
|
+
module CukeForker
|
5
|
+
class RakeTask < Rake::TaskLib
|
6
|
+
attr_accessor :name
|
7
|
+
attr_accessor :verbose
|
8
|
+
attr_accessor :features
|
9
|
+
attr_accessor :extra_args
|
10
|
+
|
11
|
+
def initialize(*args, &task_block)
|
12
|
+
setup_ivars(args)
|
13
|
+
|
14
|
+
desc 'Run CukeForker' unless ::Rake.application.last_comment
|
15
|
+
|
16
|
+
task(name, *args) do |_, task_args|
|
17
|
+
RakeFileUtils.send(:verbose, verbose) do
|
18
|
+
if task_block
|
19
|
+
task_block.call(*[self, task_args].slice(0, task_block.arity))
|
20
|
+
end
|
21
|
+
|
22
|
+
run_cukeforker
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def setup_ivars(args)
|
28
|
+
@name = args.shift || :cukeforker
|
29
|
+
|
30
|
+
split = args.index("--")
|
31
|
+
if split
|
32
|
+
@extra_args = args[0..(split-1)]
|
33
|
+
@features = args[(split+1)..-1]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def run_cukeforker
|
38
|
+
unless CukeForker::Runner.run(@features, :extra_args => @extra_args)
|
39
|
+
raise 'Test failures'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/cukeforker/runner.rb
CHANGED
data/lib/cukeforker/version.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.expand_path("../../spec_helper", __FILE__)
|
2
|
+
|
3
|
+
require 'cukeforker/rake_task'
|
4
|
+
|
5
|
+
describe CukeForker::RakeTask do
|
6
|
+
describe 'define task' do
|
7
|
+
it 'creates a cukeforker task' do
|
8
|
+
CukeForker::RakeTask.new
|
9
|
+
|
10
|
+
expect(Rake::Task.task_defined?(:cukeforker)).to be true
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'creates a named task' do
|
14
|
+
CukeForker::RakeTask.new(:run_feature)
|
15
|
+
|
16
|
+
expect(Rake::Task.task_defined?(:run_feature)).to be true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe 'running task' do
|
21
|
+
before(:each) do
|
22
|
+
Rake::Task['cukeforker'].clear if Rake::Task.task_defined?('cukeforker')
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'runs specific features' do
|
26
|
+
CukeForker::RakeTask.new do |task|
|
27
|
+
task.features = ['file1, file2']
|
28
|
+
task.verbose = false
|
29
|
+
end
|
30
|
+
|
31
|
+
expect(CukeForker::Runner).to receive(:run).and_return(true)
|
32
|
+
|
33
|
+
Rake::Task['cukeforker'].execute
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'exits with a non zero status if any tests fail' do
|
37
|
+
CukeForker::RakeTask.new do |task|
|
38
|
+
task.features = ['file1, file2']
|
39
|
+
task.verbose = false
|
40
|
+
end
|
41
|
+
|
42
|
+
expect(CukeForker::Runner).to receive(:run).and_return(false)
|
43
|
+
|
44
|
+
expect { Rake::Task['cukeforker'].execute }.to raise_error(Exception)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -126,5 +126,25 @@ module CukeForker
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
129
|
+
context 'exit status' do
|
130
|
+
let(:queue) { double(Queue) }
|
131
|
+
let(:runner) { Runner.new(queue) }
|
132
|
+
|
133
|
+
it 'returns true when there are no test failures' do
|
134
|
+
queue.stub(:has_failures? => false)
|
135
|
+
queue.should_receive(:process).with 0.2 # poll interval
|
136
|
+
queue.should_receive(:wait_until_finished)
|
137
|
+
|
138
|
+
expect(runner.run).to be_true
|
139
|
+
end
|
140
|
+
|
141
|
+
it 'returns false when there are test failures' do
|
142
|
+
queue.stub(:has_failures? => true)
|
143
|
+
queue.should_receive(:process).with 0.2 # poll interval
|
144
|
+
queue.should_receive(:wait_until_finished)
|
145
|
+
|
146
|
+
expect(runner.run).to be_false
|
147
|
+
end
|
148
|
+
end
|
129
149
|
end # Runner
|
130
150
|
end # CukeForker
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cukeforker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- lib/cukeforker/formatters/junit_scenario_formatter.rb
|
104
104
|
- lib/cukeforker/formatters/scenario_line_logger.rb
|
105
105
|
- lib/cukeforker/logging_listener.rb
|
106
|
+
- lib/cukeforker/rake_task.rb
|
106
107
|
- lib/cukeforker/recording_vnc_listener.rb
|
107
108
|
- lib/cukeforker/runner.rb
|
108
109
|
- lib/cukeforker/scenarios.rb
|
@@ -112,6 +113,7 @@ files:
|
|
112
113
|
- lib/cukeforker/worker_queue.rb
|
113
114
|
- spec/cukeforker/formatters/scenario_line_logger_spec.rb
|
114
115
|
- spec/cukeforker/logging_listener_spec.rb
|
116
|
+
- spec/cukeforker/rake_task_spec.rb
|
115
117
|
- spec/cukeforker/recording_vnc_listener_spec.rb
|
116
118
|
- spec/cukeforker/runner_spec.rb
|
117
119
|
- spec/cukeforker/scenarios_spec.rb
|
@@ -145,6 +147,7 @@ summary: Library to maintain a forking queue of Cucumber processes
|
|
145
147
|
test_files:
|
146
148
|
- spec/cukeforker/formatters/scenario_line_logger_spec.rb
|
147
149
|
- spec/cukeforker/logging_listener_spec.rb
|
150
|
+
- spec/cukeforker/rake_task_spec.rb
|
148
151
|
- spec/cukeforker/recording_vnc_listener_spec.rb
|
149
152
|
- spec/cukeforker/runner_spec.rb
|
150
153
|
- spec/cukeforker/scenarios_spec.rb
|