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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmYzYjFjN2I1NGJkMzI4NzVhZmRkMjZlYzE1ZjhhMjg1ZTM1YmU2MQ==
4
+ OGMxODc4NDY3OTdiZjAyNTYyMjI2MzlkN2Y1NjE0YWVjMGM4NjE4YQ==
5
5
  data.tar.gz: !binary |-
6
- MzFkMDY3MzcxNTVmMzVkMGM5MDRlYTgzOWFmOWRlNjBjYzI5OTk4ZQ==
6
+ ZmFjOTVmMzJlOWUzYTMwMGMzZGEyNjE4ODg3MTBmNGY1ZjBkZDA2Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDg0OWM2MDM3MjEzMGRkODJmNWNlZWQ4YzI1OWU2NjFkNTAyNjNlYzhlNWZl
10
- ZjJjNzc2M2YwNjg5OWQxMmY0MjA2MzE3ZjQ5MTFhMTUzMDMyODc3NWY3ZTIw
11
- NDFjZTczMWFhY2Y4MjRkNmYxYWU2MjIxMjYyMmRhMDI1NjYwYWQ=
9
+ ODJhMzI1MTdjODJhYjdhMTVlNGVmOWZhYjhhMjk5OTllNTBmMjcxOTZkZjhj
10
+ YzY3ZDYwNDdhN2I2MjBmY2VkNGVjZjc1YzRmZGM0MTY4OTJmOWU4MDQ2ZjJj
11
+ N2E0OGNjOWQyMzRhOGRlN2ZhNmIxNzljZTFhZDJmMjUxZjI2ZjU=
12
12
  data.tar.gz: !binary |-
13
- MTE5MzllYmIxZTgyNTM2MGQ5YTJmOThmMDA1Y2M4YTAxZDIxODMxY2NhNzA0
14
- YzQ0OTIwOWY2MGUzZGUzZmNkYzkxMGMzMDBjMmZmYTg0MjY1OTdlM2ExODg3
15
- OTAwMWJlMWU1ZjNmYTkxMzBlOGYyNjI5OTliMzdhMDNmMjFiZjg=
13
+ NmE0YmU2NDI4NjI0ZTkyZTUzODkxN2VjZmM0YjM3OTRkZmIwMzA2YTgyZDQx
14
+ ZjcxYTI4MzIyZGExMzAwMDZhYzExZjA0ODk1MDc5MDQ4YTk2MmQ0ZjI5MDdj
15
+ ZDQ3MmM0MjhmYTljNTBmYThjMTAzODY5ZTQzMTQ2NGFhZGEyYzE=
data/CHANGES CHANGED
@@ -207,4 +207,8 @@
207
207
 
208
208
  == Version 1.8.0
209
209
 
210
- * Adding step meta-sugar to PageSet
210
+ * Adding step meta-sugar to PageSet
211
+
212
+ == Version 1.8.1
213
+
214
+ * Adding StepsGenerator class
@@ -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
@@ -1,3 +1,3 @@
1
1
  class AcceptanceTest
2
- VERSION = "1.8.0"
2
+ VERSION = "1.8.1"
3
3
  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.0
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