acceptance_test 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGES +5 -1
- data/lib/acceptance_test/steps_generator.rb +56 -0
- data/lib/acceptance_test/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OGMxODc4NDY3OTdiZjAyNTYyMjI2MzlkN2Y1NjE0YWVjMGM4NjE4YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmFjOTVmMzJlOWUzYTMwMGMzZGEyNjE4ODg3MTBmNGY1ZjBkZDA2Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODJhMzI1MTdjODJhYjdhMTVlNGVmOWZhYjhhMjk5OTllNTBmMjcxOTZkZjhj
|
10
|
+
YzY3ZDYwNDdhN2I2MjBmY2VkNGVjZjc1YzRmZGM0MTY4OTJmOWU4MDQ2ZjJj
|
11
|
+
N2E0OGNjOWQyMzRhOGRlN2ZhNmIxNzljZTFhZDJmMjUxZjI2ZjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmE0YmU2NDI4NjI0ZTkyZTUzODkxN2VjZmM0YjM3OTRkZmIwMzA2YTgyZDQx
|
14
|
+
ZjcxYTI4MzIyZGExMzAwMDZhYzExZjA0ODk1MDc5MDQ4YTk2MmQ0ZjI5MDdj
|
15
|
+
ZDQ3MmM0MjhmYTljNTBmYThjMTAzODY5ZTQzMTQ2NGFhZGEyYzE=
|
data/CHANGES
CHANGED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
3
|
+
class StepsGenerator
|
4
|
+
include Singleton
|
5
|
+
|
6
|
+
def generate file_name
|
7
|
+
keywords_exp = /^(Given|When|Then|And|But)/
|
8
|
+
|
9
|
+
File.open(file_name).each_line do |line|
|
10
|
+
line = line.strip
|
11
|
+
|
12
|
+
if line !~ /^#/ and line =~ keywords_exp
|
13
|
+
title = line.gsub(keywords_exp, "").strip
|
14
|
+
|
15
|
+
params = line.gsub(/('<\w+>')|("<\w+>")|(<\w+>)|(".+")|('.+')/).to_a
|
16
|
+
new_params = []
|
17
|
+
|
18
|
+
params.each_with_index do |param, index|
|
19
|
+
key = param.gsub(/(<|>|'|")/, "").downcase
|
20
|
+
|
21
|
+
if key =~ /\s+/
|
22
|
+
key = key.underscore.gsub(/\s+/, "_")
|
23
|
+
end
|
24
|
+
|
25
|
+
value = param.gsub(/('|")/, "")
|
26
|
+
|
27
|
+
new_params[index] = [key, value]
|
28
|
+
title.gsub!(param, ":#{key}")
|
29
|
+
end
|
30
|
+
|
31
|
+
new_params.each do |key, value|
|
32
|
+
print "\n"
|
33
|
+
print "input[:#{key}] = \"#{value}\""
|
34
|
+
print "\n"
|
35
|
+
end
|
36
|
+
|
37
|
+
print "\n"
|
38
|
+
print "step '#{title}' do "
|
39
|
+
|
40
|
+
if new_params.size > 0
|
41
|
+
print "|"
|
42
|
+
|
43
|
+
new_params.each_with_index do |array, index|
|
44
|
+
print "#{array.first}"
|
45
|
+
print ", " if index < params.size-1
|
46
|
+
end
|
47
|
+
|
48
|
+
print "|"
|
49
|
+
end
|
50
|
+
|
51
|
+
print "\n\n"
|
52
|
+
print "end\n"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acceptance_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Shvets
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- lib/acceptance_test/page_set.rb
|
79
79
|
- lib/acceptance_test/screenshot_maker.rb
|
80
80
|
- lib/acceptance_test/shared_context_builder.rb
|
81
|
+
- lib/acceptance_test/steps_generator.rb
|
81
82
|
- lib/acceptance_test/turnip_ext.rb
|
82
83
|
- lib/acceptance_test/version.rb
|
83
84
|
- lib/tasks/rspec.rake
|