geordi 0.12.4 → 0.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/geordi/cuc.rb +30 -12
- data/lib/geordi/version.rb +1 -1
- metadata +3 -3
data/lib/geordi/cuc.rb
CHANGED
@@ -41,11 +41,12 @@ module Geordi
|
|
41
41
|
gem 'parallel_tests', parallel_tests_version
|
42
42
|
require 'parallel_tests'
|
43
43
|
type_arg = Gem::Version.new(::ParallelTests::VERSION) > Gem::Version.new('0.7.0') ? 'cucumber' : 'features'
|
44
|
-
features_to_run = command_line_features
|
45
|
-
features_to_run = 'features' if features_to_run
|
46
|
-
|
44
|
+
features_to_run = command_line_features
|
45
|
+
features_to_run = find_all_features_recursively('features') if features_to_run.empty?
|
46
|
+
features_to_run = features_to_run.join(" ")
|
47
|
+
parallel_tests_args = "-t #{type_arg}"
|
47
48
|
cucumber_args = command_line_args.empty? ? '' : "-o '#{escape_shell_args(command_line_args).join(" ")}'"
|
48
|
-
[use_firefox_for_selenium, 'b parallel_test', parallel_tests_args, cucumber_args].flatten.compact.join(" ")
|
49
|
+
[use_firefox_for_selenium, 'b parallel_test', parallel_tests_args, cucumber_args, "-- #{features_to_run}"].flatten.compact.join(" ")
|
49
50
|
end
|
50
51
|
|
51
52
|
|
@@ -91,20 +92,28 @@ module Geordi
|
|
91
92
|
|
92
93
|
def command_line_features
|
93
94
|
@command_line_features ||= begin
|
94
|
-
index = argv.find_index("--")
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
95
|
+
index = argv.find_index("--")
|
96
|
+
if index.nil? && argv.first && argv.first[0,1] != "-"
|
97
|
+
find_all_features_recursively(argv)
|
98
|
+
elsif index
|
99
|
+
files_or_dirs = argv[index + 1 .. -1]
|
100
|
+
find_all_features_recursively(files_or_dirs)
|
101
|
+
else
|
102
|
+
[]
|
103
|
+
end
|
101
104
|
end
|
102
105
|
end
|
103
106
|
|
104
107
|
def command_line_args
|
105
108
|
@command_line_args ||= begin
|
106
109
|
index = argv.find_index("--")
|
107
|
-
index
|
110
|
+
if index.nil? && argv.first && argv.first[0,1] == "-"
|
111
|
+
argv
|
112
|
+
elsif index
|
113
|
+
argv[0 .. index-1]
|
114
|
+
else
|
115
|
+
[]
|
116
|
+
end
|
108
117
|
end
|
109
118
|
end
|
110
119
|
|
@@ -126,6 +135,15 @@ module Geordi
|
|
126
135
|
end
|
127
136
|
end
|
128
137
|
|
138
|
+
def find_all_features_recursively(files_or_dirs)
|
139
|
+
Array(files_or_dirs).map do |file_or_dir|
|
140
|
+
if File.directory?(file_or_dir)
|
141
|
+
file_or_dir = Dir.glob(File.join(file_or_dir, "**", "*.feature"))
|
142
|
+
end
|
143
|
+
file_or_dir
|
144
|
+
end.flatten.uniq.compact
|
145
|
+
end
|
146
|
+
|
129
147
|
def features_can_run_with_parallel_tests?(features)
|
130
148
|
not features.any?{ |feature| feature.include? ":" }
|
131
149
|
end
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geordi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 12
|
9
|
-
-
|
10
|
-
version: 0.12.
|
9
|
+
- 5
|
10
|
+
version: 0.12.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|