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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff1696e76f2276ae9b96d74505ebff99c4d1b41dde86ffe565225354993f62b2
4
- data.tar.gz: 2bad07472729c2969028d42da9633501ec1dd10e863a4a36dc63859b91e6f55f
3
+ metadata.gz: eeddaf9558113dcb2df2dffd17832df45dbf3d7c0c463672d5c51207ed7330c6
4
+ data.tar.gz: f3cd8f8c1fc5293dab230465257160c2a354e939b4417695dbe819bf94d3128d
5
5
  SHA512:
6
- metadata.gz: 6af65669990d48a70a62f91fe254c26a1e1d76667e58e98b5ae60484c659cc58da02049ff94f0cf03a9c7218481b3e17b1295f9ec389c062aff0bf94f109577c
7
- data.tar.gz: 38ec9cd144372e32c9ff3b16c55caf9a8a9fc2ea27e8a0c85a5176920c4e7fd8c83a3b8f5effefba0d768619a3cb6cc0e4cbdd4881ccbf7084105477fca0cae9
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 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%"
@@ -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, :browser_folders, :default_within
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.00001
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 ||= 1
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
 
@@ -1,3 +1,4 @@
1
+ require 'rspec'
1
2
  RSpec.configure do |config|
2
3
  config.before(:suite) do
3
4
  LooksGood.cleanup
@@ -1,3 +1,3 @@
1
1
  module LooksGood
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.3"
3
3
  end
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.0
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-12 00:00:00.000000000 Z
11
+ date: 2022-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick