hiptest-publisher 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hiptest-publisher.rb +9 -4
- data/lib/hiptest-publisher/gherkin_adder.rb +11 -7
- data/lib/hiptest-publisher/nodes.rb +2 -0
- data/lib/hiptest-publisher/options_parser.rb +1 -0
- data/lib/hiptest-publisher/utils.rb +15 -0
- data/lib/templates/cucumber/output_config +1 -0
- data/lib/templates/cucumber/scenarios.hbs +3 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2ff41b7c9dc93dcb8b49350c24f3136a85f894f
|
4
|
+
data.tar.gz: bc289f734743edfc2f747b70228e2d91e8a55101
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca7ebf3223fea589aff7178c6ca1d4c9ac82ae774f5e4d0265a7e5f13f8af7cd5f9b41915a6cc5e2ec2f3b26a8bebb8e93fbcc20a805e984927e19f5908287a3
|
7
|
+
data.tar.gz: 455b088226407bce83772840057b52b7472a19b1ca5d6db27e234e0e6ed5f9705374b0436b8eb99650a9dd7b8996cd5e03301beaf0a054c2de0ff2280398df10
|
data/lib/hiptest-publisher.rb
CHANGED
@@ -197,28 +197,33 @@ module Hiptest
|
|
197
197
|
end
|
198
198
|
|
199
199
|
unless diff[:deleted].nil?
|
200
|
-
puts "#{diff[:deleted].length
|
200
|
+
puts "#{pluralize(diff[:deleted].length, "action word")} deleted:"
|
201
201
|
puts diff[:deleted].map {|d| "- #{d[:name]}"}.join("\n")
|
202
202
|
puts ""
|
203
203
|
end
|
204
204
|
|
205
205
|
unless diff[:created].nil?
|
206
|
-
puts "#{diff[:created].length
|
206
|
+
puts "#{pluralize(diff[:created].length, "action word")} created:"
|
207
207
|
puts diff[:created].map {|c| "- #{c[:name]}"}.join("\n")
|
208
208
|
puts ""
|
209
209
|
end
|
210
210
|
|
211
211
|
unless diff[:renamed].nil?
|
212
|
-
puts "#{diff[:renamed].length
|
212
|
+
puts "#{pluralize(diff[:renamed].length, "action word")} renamed:"
|
213
213
|
puts diff[:renamed].map {|r| "- #{r[:name]} => #{r[:new_name]}"}.join("\n")
|
214
214
|
puts ""
|
215
215
|
end
|
216
216
|
|
217
217
|
unless diff[:signature_changed].nil?
|
218
|
-
puts "#{diff[:signature_changed].length
|
218
|
+
puts "#{pluralize(diff[:signature_changed].length, "action word")} which signature changed:"
|
219
219
|
puts diff[:signature_changed].map {|c| "- #{c[:name]}"}.join("\n")
|
220
220
|
puts ""
|
221
221
|
end
|
222
|
+
|
223
|
+
if diff.empty?
|
224
|
+
puts "No action words changed"
|
225
|
+
puts ""
|
226
|
+
end
|
222
227
|
end
|
223
228
|
|
224
229
|
def export
|
@@ -14,20 +14,24 @@ module Hiptest
|
|
14
14
|
|
15
15
|
def update_calls
|
16
16
|
@project.find_sub_nodes(Hiptest::Nodes::Call).each do |call|
|
17
|
-
call.children[:gherkin_text] ||= "#{
|
17
|
+
call.children[:gherkin_text] ||= "#{text_annotation(call)} #{prettified(call)}"
|
18
18
|
if actionword = get_actionword(call)
|
19
|
-
actionword.children[:gherkin_annotation] ||=
|
19
|
+
actionword.children[:gherkin_annotation] ||= code_annotation(call)
|
20
20
|
actionword.children[:gherkin_pattern] ||= pattern(actionword)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
def annotation(call)
|
26
|
-
if call.children[:annotation]
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
call.children[:annotation].capitalize if call.children[:annotation]
|
27
|
+
end
|
28
|
+
|
29
|
+
def text_annotation(call)
|
30
|
+
annotation(call) || "*"
|
31
|
+
end
|
32
|
+
|
33
|
+
def code_annotation(call)
|
34
|
+
annotation(call) || "Given"
|
31
35
|
end
|
32
36
|
|
33
37
|
def prettified(call)
|
@@ -101,6 +101,7 @@ class OptionsParser
|
|
101
101
|
def self.parse(args)
|
102
102
|
options = OpenStruct.new
|
103
103
|
opt_parser = OptionParser.new do |opts|
|
104
|
+
opts.version = hiptest_publisher_version if hiptest_publisher_version
|
104
105
|
opts.banner = "Usage: ruby publisher.rb [options]"
|
105
106
|
opts.separator ""
|
106
107
|
opts.separator "Exports tests from Hiptest for automation."
|
@@ -9,6 +9,21 @@ rescue
|
|
9
9
|
'.'
|
10
10
|
end
|
11
11
|
|
12
|
+
def hiptest_publisher_version
|
13
|
+
Gem.loaded_specs['hiptest-publisher'].version.to_s
|
14
|
+
rescue
|
15
|
+
File.read("#{hiptest_publisher_path}/VERSION") if File.exists?("#{hiptest_publisher_path}/VERSION")
|
16
|
+
end
|
17
|
+
|
18
|
+
def pluralize(count, singular)
|
19
|
+
word = if count == 1
|
20
|
+
singular
|
21
|
+
else
|
22
|
+
"#{singular}s"
|
23
|
+
end
|
24
|
+
"#{count} #{word}"
|
25
|
+
end
|
26
|
+
|
12
27
|
def make_filter(options)
|
13
28
|
ids = options.filter_ids.split(',').map {|id| "filter[]=id:#{id}"}
|
14
29
|
tags = options.filter_tags.split(',').map {|tag| "filter[]=tag:#{tag}"}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiptest-publisher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiptest R&D
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -290,6 +290,7 @@ files:
|
|
290
290
|
- lib/templates/cucumber/empty.hbs
|
291
291
|
- lib/templates/cucumber/output_config
|
292
292
|
- lib/templates/cucumber/parameter.hbs
|
293
|
+
- lib/templates/cucumber/scenarios.hbs
|
293
294
|
- lib/templates/cucumber/single_scenario.hbs
|
294
295
|
- lib/templates/cucumber/single_test.hbs
|
295
296
|
- lib/templates/cucumber/step.hbs
|
@@ -513,7 +514,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
513
514
|
version: '0'
|
514
515
|
requirements: []
|
515
516
|
rubyforge_project:
|
516
|
-
rubygems_version: 2.4.
|
517
|
+
rubygems_version: 2.4.6
|
517
518
|
signing_key:
|
518
519
|
specification_version: 4
|
519
520
|
summary: Export your tests from Hiptest into executable tests.
|