acceptance_test 1.7.12 → 1.7.13

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
- OGU0NGU3MjljNzhmY2QyYWZjNDIwMGI3NjkyZjEwNTI3Y2Y5YTc3YQ==
4
+ MjI3YTg0NzY4YjYwMjY0YTUzZTEwOTU1MjQ2ZDk5NjBhYTU4ZTliMg==
5
5
  data.tar.gz: !binary |-
6
- MGExMDNlNTNkOWM5N2JhZTMxZGI5YjJjOTczOTExZWJjYTE4Y2UwNA==
6
+ YjgwMGM3YjcxYTM2YzgxY2YxZDEyMWVjYzA4MDJmZWJhNTdlYWZmNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjkzZWJmMDdmOTVjZDNkZDVhMDZhNTQwYTFhNmY5YmUyYWY2YmE4MzhmZTU1
10
- NTE3N2FmZjNmYjM3MTU1ZmQ1NDk4MmNjN2VlYzEwMmYyMmIxM2FkZDI3ODg1
11
- ZDBmZmE5NDkxYzRhYTEwNmM4YjVjYTBlMjY5MzAxNTI5ODQxNzI=
9
+ NzliYmI5M2UwMjFhOTZhZDkzNzlkNGY5ZWUzYmFhMWE1MGY4ODhjZDgyZDU2
10
+ MzIxZmNlMTdjOWZhZDc0M2JiYjIxZTYwNDdlNGZkMzlmMjk2MTE2ZTNhMTdj
11
+ ZWE2ZjVlYWQ0M2I4OTY5NDVkZGUyNWU5ZDc3MGE5YjQ1NGFmMmI=
12
12
  data.tar.gz: !binary |-
13
- NGI3Y2Y3ZWNlZWRiN2FkYjBlYjI1MGYyOTUyMWMyZmU1YTMxNzEzYzFjZDY1
14
- MzZkMWJhNmMxNTI0NWJhYTI5ZjY1MzI4N2I1MjBhYzJkNWRiNmJhYzUyN2Fj
15
- Mjk3ZTdmNjM3NjE3ZWYzYzYyNjM3MjRlNzk2NDMyYzQyMTY2Yjk=
13
+ NjNiYjVlYjQzZGM5MWFkNjhiMjAyNjFmMTUzM2RmM2UzOTNmY2QxMGE0Nzkz
14
+ MWE3NzQxYTdiY2RhNGFmYjIxZjAxYWE0ZDI2ZmI0Yzg2YmEwYTU4MDg2YmQx
15
+ MjMyNzU5Mzg5Y2MzNmUyN2QwODBlNThlYmM5OGQ0MzNmMmYwMGY=
data/CHANGES CHANGED
@@ -191,4 +191,8 @@
191
191
 
192
192
  == Version 1.7.12
193
193
 
194
+ * Bug fix
195
+
196
+ == Version 1.7.13
197
+
194
198
  * Bug fix
@@ -6,25 +6,23 @@ class ScreenshotMaker
6
6
  end
7
7
 
8
8
  def make page, options
9
- name = screenshot_name(File.basename(options[:file_path]), options[:line_number])
9
+ file_path = options[:file_path]
10
+
11
+ name = screenshot_name(build_name(file_path), options[:line_number])
10
12
  path = File.expand_path("#{basedir}/#{name}")
11
13
 
12
14
  page.save_screenshot(path)
13
15
  end
14
16
 
15
- def screenshot_name filename, line_number=nil
16
- "#{filename}#{line_number ? '-'+line_number : ''}.png"
17
- end
18
-
19
17
  def screenshot_url options
20
18
  file_path = options[:file_path]
21
19
 
22
- if file_path =~ /http:/ or file_path =~ /https:/ or file_path =~ /ftp:/
23
- name = screenshot_name(File.basename(options[:file_path]), options[:line_number])
20
+ if options[:screenshot_url_base]
21
+ name = screenshot_name(build_name(file_path), options[:line_number])
24
22
 
25
- "#{file_path}/#{name}"
23
+ "#{options[:screenshot_url_base]}/#{name}"
26
24
  else
27
- name = screenshot_name(File.basename(options[:file_path]), options[:line_number])
25
+ name = screenshot_name(build_name(file_path), options[:line_number])
28
26
 
29
27
  path = File.expand_path("#{basedir}/#{name}")
30
28
 
@@ -32,4 +30,26 @@ class ScreenshotMaker
32
30
  end
33
31
  end
34
32
 
33
+ private
34
+
35
+ def screenshot_name name, line_number=nil
36
+ "#{name}#{line_number ? '-'+line_number.to_s : ''}.png"
37
+ end
38
+
39
+ def build_name path
40
+ full_path = File.expand_path(path)
41
+ extension = File.extname(path)
42
+
43
+ index1 = full_path.index("/spec")
44
+ index2 = full_path.index(extension)
45
+
46
+ name = full_path[index1+1..index2-1].gsub("/", "_")
47
+
48
+ name = name[5..-1] if name =~ /^spec_/
49
+ name = name[9..-1] if name =~ /^features_/
50
+ name = name[11..-1] if name =~ /^acceptance_/
51
+
52
+ name
53
+ end
54
+
35
55
  end
@@ -1,3 +1,3 @@
1
1
  class AcceptanceTest
2
- VERSION = "1.7.12"
2
+ VERSION = "1.7.13"
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.7.12
4
+ version: 1.7.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets