parallel_calabash 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd0310f0eceb97f606c062f75d86fe31a34e2ef8
|
4
|
+
data.tar.gz: d2d5e1269d34ebb3888dc97da4ec38d3b6c9b107
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f597394492d9a43b51271e7137711a18f067af855fa2577c9c99002e362d943e870909e8f83dd244410467c52b05236dd459b119e530bc7a96501dd322ccf78
|
7
|
+
data.tar.gz: a303594e563948734facfbccbe86a423706d8e38516124ab5c3ce273db8bef29d39de2ec835b4859cd403f4c80e0bc7f778c3167a322b5c88b9bbf40d8c53e4a
|
@@ -83,16 +83,22 @@ module ParallelCalabash
|
|
83
83
|
%x( cucumber #{options[:cucumber_options]} --dry-run -f json --out parallel_calabash_dry_run.json #{options[:feature_folder].join(' ')} )
|
84
84
|
end
|
85
85
|
|
86
|
-
def feature_files_in_folder(
|
87
|
-
if File.directory?(
|
88
|
-
files = Dir[File.join(
|
86
|
+
def feature_files_in_folder(feature_dir_or_file)
|
87
|
+
if File.directory?(feature_dir_or_file.first)
|
88
|
+
files = Dir[File.join(feature_dir_or_file, "**{,/*/**}/*")].uniq
|
89
89
|
files.grep(/\.feature$/)
|
90
|
-
elsif
|
91
|
-
|
90
|
+
elsif feature_folder_has_single_feature?(feature_dir_or_file)
|
91
|
+
feature_dir_or_file
|
92
|
+
elsif File.file?(feature_dir_or_file.first)
|
93
|
+
scenarios = File.open(feature_dir_or_file.first).collect{ |line| line.split(' ') }
|
92
94
|
scenarios.flatten
|
93
95
|
end
|
94
96
|
end
|
95
97
|
|
98
|
+
def feature_folder_has_single_feature?(feature_dir)
|
99
|
+
feature_dir.first.include?('.feature')
|
100
|
+
end
|
101
|
+
|
96
102
|
def weight_of_feature(feature_file, weighing_factor)
|
97
103
|
content = File.read(feature_file)
|
98
104
|
content.scan(/#{weighing_factor}\b/).size
|
@@ -54,6 +54,11 @@ describe ParallelCalabash::FeatureGrouper do
|
|
54
54
|
["spec/test_data/features/aaa.feature", "spec/test_data/features/bbb.feature", "spec/test_data/features/ccc.feature", "spec/test_data/features/ddd.feature", "spec/test_data/features/eee.feature", "spec/test_data/features/fff.feature"]]
|
55
55
|
end
|
56
56
|
|
57
|
+
it 'should create 2 group for concurrent 2 processes if single feature file is given' do
|
58
|
+
expect(ParallelCalabash::FeatureGrouper.feature_groups({:feature_folder => ['spec/test_data/features/aaa.feature'], :concurrent => true}, 2)).to eq \
|
59
|
+
[["spec/test_data/features/aaa.feature"], ["spec/test_data/features/aaa.feature"]]
|
60
|
+
end
|
61
|
+
|
57
62
|
end
|
58
63
|
|
59
64
|
describe :feature_weight do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_calabash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajdeep
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|