looks_good 1.1.0 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/looks_good/configuration.rb +4 -3
- data/lib/looks_good/matchers/look_like_matcher.rb +3 -3
- data/lib/looks_good/rspec_config.rb +1 -0
- data/lib/looks_good/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeddaf9558113dcb2df2dffd17832df45dbf3d7c0c463672d5c51207ed7330c6
|
4
|
+
data.tar.gz: f3cd8f8c1fc5293dab230465257160c2a354e939b4417695dbe819bf94d3128d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 300c41d0595bb26662c38f73a9604e6c830155efcc5d061442a7dfe7d142dcfd27eada51b9630da7f9014f11962854eafca7f37b0128e9d7d731dc248cb75e1b
|
7
|
+
data.tar.gz: 0b6656fa01eb2179cb42f318bd65323ecd14322a35dff564526c0d45ac18c8fb4254e4301d7360b45fc08fa6cacdd47b6e317c19691d119c49c30ffaa0d11f55
|
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
|
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.
|
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%"
|
@@ -5,7 +5,8 @@ module LooksGood
|
|
5
5
|
|
6
6
|
class << self
|
7
7
|
|
8
|
-
attr_accessor :fuzz, :reference_image_path, :max_no_tries, :sleep_between_tries,
|
8
|
+
attr_accessor :fuzz, :reference_image_path, :max_no_tries, :sleep_between_tries,
|
9
|
+
:browser_folders, :default_within, :scale_amount
|
9
10
|
|
10
11
|
attr_reader :paths
|
11
12
|
|
@@ -15,7 +16,7 @@ module LooksGood
|
|
15
16
|
end
|
16
17
|
|
17
18
|
def default_within
|
18
|
-
@default_within ||= 0.
|
19
|
+
@default_within ||= 0.0001
|
19
20
|
end
|
20
21
|
|
21
22
|
# allows retina mac screenshots to be scaled to expected size
|
@@ -24,7 +25,7 @@ module LooksGood
|
|
24
25
|
end
|
25
26
|
|
26
27
|
def max_no_tries
|
27
|
-
@max_no_tries ||=
|
28
|
+
@max_no_tries ||= 2
|
28
29
|
end
|
29
30
|
|
30
31
|
def fuzz
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'looks_good'
|
2
|
-
|
3
|
-
RSpec::Matchers.define :look_like do |expected|
|
2
|
+
require 'rspec'
|
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
|
|
data/lib/looks_good/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: looks_good
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Jennings
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|