symilaa 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,6 +38,11 @@ module Symilaa
38
38
  end
39
39
  end
40
40
 
41
+ def get_file_name path, extension
42
+ "#{path}#{extension}"
43
+ end
44
+
45
+
41
46
  def create_directories directories
42
47
  directories.each do |dir|
43
48
  FileUtils.mkdir_p File.join(base_dir, dir)
@@ -103,9 +108,13 @@ module Symilaa
103
108
  FileUtils.mkdir_p(File.join screenshots_generated_this_run_dir, sub_directory, scenario_name)
104
109
  end
105
110
 
106
- def create_screenshot_filename sub_directory
111
+ def create_screenshot_filename sub_directory, unique_filename_required
107
112
  file_name = "#{browser_info.browser_name.capitalize.parameterize}#{version_if_required}_#{browser_info.platform.capitalize}_#{title}"
113
+ if unique_filename_required
108
114
  get_unique_file_name "#{screenshots_generated_this_run_dir}/#{sub_directory}#{scenario_name}/#{file_name}", '.png'
115
+ else
116
+ get_file_name "#{screenshots_generated_this_run_dir}/#{sub_directory}#{scenario_name}/#{file_name}", '.png'
117
+ end
109
118
  end
110
119
 
111
120
  def save_screenshot screenshot_path
@@ -116,11 +125,11 @@ module Symilaa
116
125
  "#{generated_screenshot_path}_difference.gif".gsub('screenshots_generated_this_run', 'differences_in_screenshots_this_run')
117
126
  end
118
127
 
119
- def check_screen_against_reference_shot target_sub_directory
128
+ def check_screen_against_reference_shot target_sub_directory, unique_filename_required = true
120
129
  create_directories %w[screenshots_generated_this_run differences_in_screenshots_this_run]
121
130
  create_screenshot_directory target_sub_directory
122
131
 
123
- generated_screenshot_path = create_screenshot_filename target_sub_directory
132
+ generated_screenshot_path = create_screenshot_filename target_sub_directory, unique_filename_required
124
133
  screenshot_name = File.basename generated_screenshot_path
125
134
  reference_path = File.join reference_screenshots, target_sub_directory, scenario_name, screenshot_name
126
135
  difference_file = difference_file_path generated_screenshot_path
@@ -1,3 +1,3 @@
1
1
  module Symilaa
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symilaa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-16 00:00:00.000000000Z
12
+ date: 2012-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
16
- requirement: &10350820 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *10350820
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: guard-minitest
27
- requirement: &10347080 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *10347080
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rake
38
- requirement: &10346600 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *10346600
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: rb-inotify
49
- requirement: &10346020 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '0'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *10346020
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: rmagick
60
- requirement: &10345500 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,7 +85,12 @@ dependencies:
65
85
  version: '0'
66
86
  type: :runtime
67
87
  prerelease: false
68
- version_requirements: *10345500
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  description: ! "Using the wonders of RMagick, this wonderful gem will produce a boolean
70
95
  result based on the computed similarity\n of the two images passed."
71
96
  email:
@@ -111,21 +136,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
136
  - - ! '>='
112
137
  - !ruby/object:Gem::Version
113
138
  version: '0'
114
- segments:
115
- - 0
116
- hash: 1420664103671419736
117
139
  required_rubygems_version: !ruby/object:Gem::Requirement
118
140
  none: false
119
141
  requirements:
120
142
  - - ! '>='
121
143
  - !ruby/object:Gem::Version
122
144
  version: '0'
123
- segments:
124
- - 0
125
- hash: 1420664103671419736
126
145
  requirements: []
127
146
  rubyforge_project: symilaa
128
- rubygems_version: 1.8.10
147
+ rubygems_version: 1.8.24
129
148
  signing_key:
130
149
  specification_version: 3
131
150
  summary: Compares images for similarity. Amazebears.