capybara-screenshot-diff 0.15.1 → 1.0.0

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: b36c962b23a2af28438bdfa5246f2f9bf612c705929bd57d3bdf023183e64317
4
- data.tar.gz: e5bd86681099718612bf44099acb1cfdf958d906830f3a1059d3910915b34571
3
+ metadata.gz: 1ed4cf559968821a2689708d36fe556f97b9f0c730a09ab39ca05f1b991ca8ea
4
+ data.tar.gz: 4749b6bec782a95edd8fe51ec6d216c505fb0b606769738cb0192f37480c67c8
5
5
  SHA512:
6
- metadata.gz: bc296fd709ccd6a931cf2fc7de0e893ac084216b6c8fe1c8018e50e8ce1e716355f19db5cbaba457797db5e18f7a757561317b8c26a7967d118c3afd5ecaf680
7
- data.tar.gz: 03e5c3b3a7351275d1472361cc0cb7cb705b7bf94abe61ac0f41dd27faf495a2e53c2f5085243d1ac598e8660fb0d74bd974e558289d1f1e469fe10a43789b1b
6
+ metadata.gz: 2ce1837fa5049d423afad82daa6b0c589d1cf2670da9268584b9c16ce589abb7a91fd4d11601c0639037da102754e8a5696d9e143949074354f70ffca38e8499
7
+ data.tar.gz: 1d3df4ef083b2980e31f59d15b783c9fd26474a1a550f5c8c4d5405abf523bab798b0f21fa246c2b872053dddf79d72c21bb52d412aaa8b40fd6fb23dfca2b96
@@ -1,12 +1,17 @@
1
1
  inherit_from: .rubocop_todo.yml
2
+ require: rubocop-performance
2
3
 
3
4
  AllCops:
4
- TargetRubyVersion: 2.2
5
+ TargetRubyVersion: 2.3
5
6
  DisplayCopNames: true
6
7
  DisplayStyleGuide: true
7
8
  Exclude:
8
9
  - gemfiles/vendor/**/*
9
10
 
11
+ Layout/AlignArguments:
12
+ EnforcedStyle: with_fixed_indentation
13
+ IndentationWidth: 4
14
+
10
15
  Layout/AlignParameters:
11
16
  EnforcedStyle: with_fixed_indentation
12
17
  IndentationWidth: 4
@@ -2,12 +2,15 @@ language: ruby
2
2
  sudo: false
3
3
  cache: bundler
4
4
  rvm:
5
- - jruby-9.2.0.0
6
- - ruby-2.5.1
7
- - ruby-2.4.4
8
- - ruby-2.3.7
5
+ - jruby-9.2.7.0
6
+ - ruby-2.6.3
7
+ - ruby-2.5.5
8
+ - ruby-2.4.6
9
+ - ruby-2.3.8
10
+ - truffleruby-1.0.0-rc16
9
11
 
10
12
  gemfile:
13
+ - gemfiles/rails60.gemfile
11
14
  - gemfiles/rails52.gemfile
12
15
  - gemfiles/rails51.gemfile
13
16
  - gemfiles/rails50.gemfile
@@ -19,7 +22,12 @@ env:
19
22
  jdk:
20
23
  - oraclejdk8
21
24
 
22
- # FIXME(uwe): Remove when fixed: https://github.com/travis-ci/travis-ci/issues/9383
23
- before_install:
24
- - gem install bundler
25
- # EMXIF
25
+ matrix:
26
+ fast_finish: true
27
+ exclude:
28
+ - rvm: ruby-2.4.6
29
+ gemfile: gemfiles/rails60.gemfile
30
+ - rvm: ruby-2.3.8
31
+ gemfile: gemfiles/rails60.gemfile
32
+ allow_failures:
33
+ - rvm: truffleruby-1.0.0-rc16
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in capybara-screenshot-diff.gemspec
data/README.md CHANGED
@@ -12,11 +12,11 @@ taking screen shots and comparing them to the previous revision.
12
12
 
13
13
  ## Installation
14
14
 
15
- Add this line to your application's Gemfile:
15
+ Add these lines to your application's Gemfile:
16
16
 
17
17
  ```ruby
18
18
  gem 'capybara-screenshot-diff'
19
- gem 'oily_png', platform :ruby
19
+ gem 'oily_png', platform: :ruby
20
20
  ```
21
21
 
22
22
  And then execute:
@@ -145,7 +145,7 @@ end
145
145
  test 'my subfeature' do
146
146
  screenshot_group 'subfeature'
147
147
  visit '/feature'
148
- click_button 'Interresting button'
148
+ click_button 'Interesting button'
149
149
  screenshot 'subfeature_index'
150
150
  click_button 'Perform action'
151
151
  screenshot 'action_performed'
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rake/testtask'
3
5
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'capybara/screenshot/diff'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'capybara/screenshot/diff/version'
@@ -10,7 +12,7 @@ Gem::Specification.new do |spec|
10
12
  spec.summary = 'Track your GUI changes with diff assertions'
11
13
  spec.description = 'Save screen shots and track changes with graphical diff'
12
14
  spec.homepage = 'https://github.com/donv/capybara-screenshot-diff'
13
- spec.required_ruby_version = '~> 2.2'
15
+ spec.required_ruby_version = '~> 2.3'
14
16
  spec.license = 'MIT'
15
17
  spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
16
18
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -18,7 +20,7 @@ Gem::Specification.new do |spec|
18
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
21
  spec.require_paths = ['lib']
20
22
 
21
- spec.add_runtime_dependency 'actionpack', '>= 4.2', '< 5.3'
23
+ spec.add_runtime_dependency 'actionpack', '>= 4.2', '< 7'
22
24
  spec.add_runtime_dependency 'capybara', '>= 2', '< 4'
23
25
  spec.add_runtime_dependency 'chunky_png', '~> 1.3'
24
26
 
@@ -27,5 +29,6 @@ Gem::Specification.new do |spec|
27
29
  spec.add_development_dependency 'minitest-reporters'
28
30
  spec.add_development_dependency 'rake'
29
31
  spec.add_development_dependency 'rubocop', '~> 0.54'
32
+ spec.add_development_dependency 'rubocop-performance', '~> 0.0'
30
33
  spec.add_development_dependency 'simplecov', '~> 0.11'
31
34
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gem 'capybara', '~> 2.0'
@@ -6,4 +8,5 @@ gem 'minitest', '~> 5.0'
6
8
  gem 'minitest-reporters'
7
9
  gem 'rake'
8
10
  gem 'rubocop', '~> 0.39'
11
+ gem 'rubocop-performance', '~> 0.0'
9
12
  gem 'simplecov', '~> 0.11'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  eval File.read("#{__dir__}/common.gemfile")
2
4
 
3
5
  gem 'actionpack', '~>4.2.7'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  eval File.read("#{__dir__}/common.gemfile")
2
4
 
3
5
  gem 'actionpack', '~>5.0.1'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  eval File.read("#{__dir__}/common.gemfile")
2
4
 
3
5
  gem 'actionpack', '~>5.1.2'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  eval File.read("#{__dir__}/common.gemfile")
2
4
 
3
5
  gem 'actionpack', '~>5.2.1'
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ eval File.read("#{__dir__}/common.gemfile")
4
+
5
+ gem 'actionpack', '~>6.0.0.rc1'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'capybara/dsl'
2
4
  require 'capybara/screenshot/diff/version'
3
5
  require 'capybara/screenshot/diff/image_compare'
@@ -29,7 +31,7 @@ module Capybara
29
31
  end
30
32
 
31
33
  def screenshot_area_abs
32
- "#{root}/#{screenshot_area}".freeze
34
+ "#{root}/#{screenshot_area}"
33
35
  end
34
36
  end
35
37
 
@@ -58,7 +60,7 @@ module Capybara
58
60
  clas.teardown do
59
61
  if Capybara::Screenshot::Diff.enabled && @test_screenshots
60
62
  test_screenshot_errors = @test_screenshots
61
- .map { |caller, name, compare| assert_image_not_changed(caller, name, compare) }.compact
63
+ .map { |caller, name, compare| assert_image_not_changed(caller, name, compare) }.compact!
62
64
  fail(test_screenshot_errors.join("\n\n")) if test_screenshot_errors.any?
63
65
  end
64
66
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'chunky_png'
2
4
 
3
5
  module Capybara
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Capybara
2
4
  module Screenshot
3
5
  module Os
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'os'
2
4
 
3
5
  module Capybara
@@ -58,7 +60,7 @@ module Capybara
58
60
  FileUtils.mv comparison.new_file_name, previous_file_name
59
61
  end
60
62
  ensure
61
- blurred_input.click if blurred_input
63
+ blurred_input&.click
62
64
  end
63
65
 
64
66
  private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'English'
2
4
  require 'capybara'
3
5
  require 'action_controller'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'os'
2
4
  module Capybara
3
5
  module Screenshot
@@ -3,7 +3,7 @@
3
3
  module Capybara
4
4
  module Screenshot
5
5
  module Diff
6
- VERSION = '0.15.1'.freeze
6
+ VERSION = '1.0.0'
7
7
  end
8
8
  end
9
9
  end
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby -w
2
+ # frozen_string_literal: true
2
3
 
3
4
  system('rubocop --auto-correct') || exit(1)
4
5
 
@@ -15,21 +16,27 @@ def run_script(ruby, env, gemfile)
15
16
  puts "Testing #{ruby} #{gemfile} #{env}"
16
17
  puts
17
18
  system("chruby-exec #{ruby} -- bundle exec rake") || exit(1)
19
+ puts "Testing #{ruby} #{gemfile} OK"
18
20
  puts '*' * 80
19
21
  end
20
22
 
21
23
  def use_gemfile(ruby, gemfile, update_gemfiles)
22
24
  puts '$' * 80
23
- puts "Testing #{gemfile}"
24
- puts
25
25
  ENV['BUNDLE_GEMFILE'] = gemfile
26
+
27
+ bundler_version = `grep -A1 "BUNDLED WITH" #{gemfile}.lock | tail -n 1`
28
+ bundler_version = '~> 2.0' if bundler_version.strip.empty?
29
+
30
+ version_arg = "-v '#{bundler_version}'"
31
+ bundler_gem_check_cmd = "chruby-exec #{ruby} -- gem query -i -n bundler #{version_arg} >/dev/null"
32
+ system "#{bundler_gem_check_cmd} || chruby-exec #{ruby} -- gem install #{version_arg} bundler" || exit(1)
33
+
26
34
  if update_gemfiles
27
35
  system "chruby-exec #{ruby} -- bundle update"
28
36
  else
29
- system "chruby-exec #{ruby} -- bundle check || chruby-exec #{ruby} -- bundle install"
37
+ system "chruby-exec #{ruby} -- bundle check >/dev/null || chruby-exec #{ruby} -- bundle install"
30
38
  end || exit(1)
31
39
  yield
32
- puts "Testing #{gemfile} OK"
33
40
  puts '$' * 80
34
41
  end
35
42
 
@@ -40,12 +47,10 @@ travis['rvm'].each do |ruby|
40
47
  puts "Testing #{ruby}"
41
48
  puts
42
49
  system "ruby-install --no-reinstall #{ruby}" || exit(1)
43
- bundler_gem_check_cmd = "chruby-exec #{ruby} -- gem query -i -n bundler >/dev/null"
44
- system "#{bundler_gem_check_cmd} || chruby-exec #{ruby} -- gem install bundler" || exit(1)
45
50
  travis['gemfile'].each do |gemfile|
46
51
  if travis['matrix'] &&
47
- (travis['matrix']['exclude'].to_a + travis['matrix']['allowed_failures'].to_a)
48
- .any? { |f| f['rvm'] == ruby && f['gemfile'] == gemfile }
52
+ (travis['matrix']['exclude'].to_a + travis['matrix']['allow_failures'].to_a)
53
+ .any? { |f| f['rvm'] == ruby && (f['gemfile'].nil? || f['gemfile'] == gemfile) }
49
54
  puts 'Skipping known failure.'
50
55
  next
51
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-screenshot-diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-11 00:00:00.000000000 Z
11
+ date: 2019-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '4.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.3'
22
+ version: '7'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '4.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.3'
32
+ version: '7'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: capybara
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +134,20 @@ dependencies:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0.54'
137
+ - !ruby/object:Gem::Dependency
138
+ name: rubocop-performance
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: '0.0'
144
+ type: :development
145
+ prerelease: false
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - "~>"
149
+ - !ruby/object:Gem::Version
150
+ version: '0.0'
137
151
  - !ruby/object:Gem::Dependency
138
152
  name: simplecov
139
153
  requirement: !ruby/object:Gem::Requirement
@@ -172,6 +186,7 @@ files:
172
186
  - gemfiles/rails50.gemfile
173
187
  - gemfiles/rails51.gemfile
174
188
  - gemfiles/rails52.gemfile
189
+ - gemfiles/rails60.gemfile
175
190
  - lib/capybara/screenshot/diff.rb
176
191
  - lib/capybara/screenshot/diff/image_compare.rb
177
192
  - lib/capybara/screenshot/diff/os.rb
@@ -193,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
208
  requirements:
194
209
  - - "~>"
195
210
  - !ruby/object:Gem::Version
196
- version: '2.2'
211
+ version: '2.3'
197
212
  required_rubygems_version: !ruby/object:Gem::Requirement
198
213
  requirements:
199
214
  - - ">="