looks_good 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff1696e76f2276ae9b96d74505ebff99c4d1b41dde86ffe565225354993f62b2
4
- data.tar.gz: 2bad07472729c2969028d42da9633501ec1dd10e863a4a36dc63859b91e6f55f
3
+ metadata.gz: 453e5498b4740e2fe1c415307921f1acaf410c7d6f6395ea531916249c30792a
4
+ data.tar.gz: 3f08a7bb2ccb8d860072783bc7dc3fd96fa528a8826d8d1a2f2e401bdb94cb99
5
5
  SHA512:
6
- metadata.gz: 6af65669990d48a70a62f91fe254c26a1e1d76667e58e98b5ae60484c659cc58da02049ff94f0cf03a9c7218481b3e17b1295f9ec389c062aff0bf94f109577c
7
- data.tar.gz: 38ec9cd144372e32c9ff3b16c55caf9a8a9fc2ea27e8a0c85a5176920c4e7fd8c83a3b8f5effefba0d768619a3cb6cc0e4cbdd4881ccbf7084105477fca0cae9
6
+ metadata.gz: f9b731e277ff3015ef89693bb4595e7c4d1346bd244615e989e57ea4395a055d73239ec16cd88721052d8154b5edc38720f5ecff18a64d055dbf2408d8f92d9d
7
+ data.tar.gz: 58cd545954d8d637f5577184f2d2c39c57716c48ecf86237df7c86ba96b86b70a52d29a9978ab390714db1182cc1b75fb68ab5b3a8829ebdb4b60e22e3c68954
data/README.md CHANGED
@@ -78,10 +78,10 @@ Also created are subfolders:
78
78
  - tmp/diff/ - will hold the visual diff images for inspection when comparison fails
79
79
 
80
80
  #### max_no_tries
81
- - sets how many times looks_good will try and match the element against the reference image. Handy to reduce fragility of tests due to animations and load times. Defaults to 1.
81
+ - sets how many times looks_good will try and match the element against the reference image. Handy to reduce fragility of tests due to animations and load times. Defaults to 2.
82
82
 
83
83
  #### default_within
84
- - a float between 0 and 1 that sets the default tolerance for visual differences. default is 0.00001, which is strict but not absolute 0. Larger screenshots will be less sensitive to subtle differences as a percentage.
84
+ - a float between 0 and 1 that sets the default tolerance for visual differences. default is 0.0001, which is strict but not absolute 0. Larger screenshots will be less sensitive to subtle differences as a percentage.
85
85
 
86
86
  #### fuzz
87
87
  - allows pixels to not need to match exactly. a string percentage value, provided to imagemagick as fuzz value for comparison. default is "10%"
@@ -15,7 +15,7 @@ module LooksGood
15
15
  end
16
16
 
17
17
  def default_within
18
- @default_within ||= 0.00001
18
+ @default_within ||= 0.0001
19
19
  end
20
20
 
21
21
  # allows retina mac screenshots to be scaled to expected size
@@ -24,7 +24,7 @@ module LooksGood
24
24
  end
25
25
 
26
26
  def max_no_tries
27
- @max_no_tries ||= 1
27
+ @max_no_tries ||= 2
28
28
  end
29
29
 
30
30
  def fuzz
@@ -1,6 +1,6 @@
1
1
  require 'looks_good'
2
2
 
3
- RSpec::Matchers.define :look_like do |expected|
3
+ RSpec::Matchers.define :look_like do |expected, within: LooksGood::Configuration.default_within|
4
4
  result = nil
5
5
  match do |actual|
6
6
  if expected.is_a?(Symbol)
@@ -8,7 +8,7 @@ RSpec::Matchers.define :look_like do |expected|
8
8
  path_to = called_by_file.split("_spec.rb").first.split("spec/").last
9
9
  expected = File.join(path_to, "#{expected}.png")
10
10
  end
11
- result = LooksGood.check(expected, actual)
11
+ result = LooksGood.check(expected, actual, within: within)
12
12
  result[:result]
13
13
  end
14
14
 
@@ -1,3 +1,3 @@
1
1
  module LooksGood
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: looks_good
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Jennings