percy-capybara 2.5.0 → 2.5.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
  SHA1:
3
- metadata.gz: a93e613a082603c5384a75f77067ba5f9c54d610
4
- data.tar.gz: 78c5eaf278c3216124c5f1f0e1bd8d8bfc9face1
3
+ metadata.gz: 6ba34ea074b4869f59bc97456d10244725ab00c4
4
+ data.tar.gz: c582901df940381843c536adae6b12cf925de398
5
5
  SHA512:
6
- metadata.gz: 206802cab6fac788341736da0cd30ff3775d88b4e87d498126fb826025924d94b2e06135bc6d895cecc49e9bd01e850b0f5f993b3b51e933fbfc2747944f0689
7
- data.tar.gz: ab66d080a77fbd298288bafe18ca27014f66c62e5e57cc5274209f298962a1e8a202c84bf796c48565c2e6f74d831e759f83895e50fe6f15d634715483b5bff8
6
+ metadata.gz: 8a6b638286d1e7be3567b2e72c8a3ae8ba24e0da8f0cb3491d6caf49b1a1f22424db100ed1d168b335aa86bde8f05b5dc4c7f5f607e55360ba68b3e277b6090d
7
+ data.tar.gz: 551f496366ba9956bb969d1b9d400cace00bcb87faa62059bb298077d445793e9ffd51216563cc5c97c68dd669871e7d271535cc8d72b84ce4cf8e7d3ad6ac10
data/.rubocop.yml CHANGED
@@ -58,6 +58,32 @@ Style/TrailingCommaInLiteral:
58
58
  RSpec/MessageSpies:
59
59
  EnforcedStyle: receive
60
60
 
61
+ Style/FileName:
62
+ Exclude:
63
+ - 'Gemfile'
64
+ - 'Guardfile'
65
+ - 'percy-capybara.gemspec'
66
+
67
+ Style/EmptyLineAfterMagicComment:
68
+ Exclude:
69
+ - 'percy-capybara.gemspec'
70
+
71
+ Style/PercentLiteralDelimiters:
72
+ Exclude:
73
+ - 'percy-capybara.gemspec'
74
+
75
+ Style/UnneededPercentQ:
76
+ Exclude:
77
+ - 'percy-capybara.gemspec'
78
+
79
+ Style/RegexpLiteral:
80
+ Exclude:
81
+ - 'percy-capybara.gemspec'
82
+
83
+ Style/SymbolArray:
84
+ Exclude:
85
+ - 'spec/spec_helper.rb'
86
+
61
87
  # Will be able to do this in >= v1.11
62
88
  # RSpec/DescribedClass:
63
89
  # EnforcedStyle: explicit
data/Gemfile CHANGED
@@ -9,6 +9,6 @@ gem 'guard-rspec', require: false
9
9
  # gem 'percy-client', path: '~/src/percy-client'
10
10
 
11
11
  group :test do
12
- gem 'rubocop'
12
+ gem 'rubocop', '~> 0.48.0'
13
13
  gem 'rubocop-rspec'
14
14
  end
@@ -19,7 +19,7 @@ module Percy
19
19
  # influenced by any HTTP middleware/restrictions. This helps us avoid causing lots of
20
20
  # problems for people using gems like VCR/WebMock. We also disable certificate checking
21
21
  # because, as odd as that is, it's the default state for Selenium Firefox and others.
22
- output = `curl --insecure -v -o #{temppath} "#{url.shellescape}" 2>&1`
22
+ output = `curl --compressed --insecure -v -o #{temppath} "#{url.shellescape}" 2>&1`
23
23
  content_type = output.match(/< Content-Type:(.*)/i)
24
24
  content_type = content_type[1].strip if content_type
25
25
 
@@ -9,7 +9,7 @@ module Percy
9
9
  # This loader uses JavaScript to discover page resources, so specs must be tagged with
10
10
  # "js: true" because the default Rack::Test driver does not support executing JavaScript.
11
11
  class NativeLoader < BaseLoader # rubocop:disable ClassLength
12
- PATH_REGEX = /\A\/[^\\s\"']*/
12
+ PATH_REGEX = %r{\A/[^\\s\"']*}
13
13
  DATA_URL_REGEX = /\Adata:/
14
14
  LOCAL_HOSTNAMES = [
15
15
  'localhost',
@@ -93,16 +93,20 @@ module Percy
93
93
  end
94
94
 
95
95
  def _asset_logical_paths
96
- # Re-implement the same technique that "rake assets:precompile" uses to generate the
97
- # list of asset paths to include in compiled assets. https://goo.gl/sy2R4z
98
- # We can't just use environment.each_logical_path without any filters, because then
99
- # we will attempt to compile assets before they're rendered (such as _mixins.css).
100
- precompile_list = sprockets_options.precompile
101
- logical_paths = sprockets_environment.each_logical_path(*precompile_list).to_a
102
- logical_paths += precompile_list.flatten.select do |filename|
103
- Pathname.new(filename).absolute? if filename.is_a?(String)
96
+ if _rails && _rails.application.respond_to?(:precompiled_assets)
97
+ _rails.application.precompiled_assets
98
+ else
99
+ # Re-implement the same technique that "rake assets:precompile" uses to generate the
100
+ # list of asset paths to include in compiled assets. https://goo.gl/sy2R4z
101
+ # We can't just use environment.each_logical_path without any filters, because then
102
+ # we will attempt to compile assets before they're rendered (such as _mixins.css).
103
+ precompile_list = sprockets_options.precompile
104
+ logical_paths = sprockets_environment.each_logical_path(*precompile_list).to_a
105
+ logical_paths += precompile_list.flatten.select do |filename|
106
+ Pathname.new(filename).absolute? if filename.is_a?(String)
107
+ end
108
+ logical_paths.uniq
104
109
  end
105
- logical_paths.uniq
106
110
  end
107
111
  end
108
112
  end
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  module Capybara
3
- VERSION = '2.5.0'.freeze
3
+ VERSION = '2.5.1'.freeze
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'capybara-webkit', '>= 1.6', '< 1.12.0' # 1.12.0 breaks specs
28
28
  spec.add_development_dependency 'selenium-webdriver'
29
29
  spec.add_development_dependency 'webmock', '~> 1'
30
- spec.add_development_dependency 'mime-types', '< 3' # For Ruby 1.9 testing support.
30
+ spec.add_development_dependency 'mime-types', '< 3' # For Ruby 1.9 testing support.
31
31
  spec.add_development_dependency 'faraday', '>= 0.8'
32
32
  spec.add_development_dependency 'sprockets', '>= 3.2.0'
33
33
  end
@@ -225,7 +225,7 @@ RSpec.describe Percy::Capybara::Loaders::NativeLoader do
225
225
  content = File.read(path)
226
226
  # In Ruby 1.9.3 the SVG mimetype is not registered so our mini ruby webserver doesn't serve
227
227
  # the correct content type. Allow either to work here so we can test older Rubies fully.
228
- expect(resource.mimetype).to match(/image\/svg\+xml|application\/octet-stream/)
228
+ expect(resource.mimetype).to match(%r{image/svg\+xml|application/octet-stream})
229
229
  expected_sha = Digest::SHA256.hexdigest(content)
230
230
  expect(Digest::SHA256.hexdigest(resource.content)).to eq(expected_sha)
231
231
  expect(resource.sha).to eq(expected_sha)
@@ -24,7 +24,7 @@ RSpec.describe Percy::Capybara::Loaders::SprocketsLoader do
24
24
  let(:sprockets_options) do
25
25
  options = double('options')
26
26
  # Set specific files we want to compile. In normal use, this would be all asset files.
27
- precompile_list = [/(?:\/|\\|\A)(base|digested)\.(css|js)$|\.map|\.png/]
27
+ precompile_list = [%r{(?:/|\\|\A)(base|digested)\.(css|js)$|\.map|\.png}]
28
28
  allow(options).to receive(:precompile).and_return(precompile_list)
29
29
  allow(options).to receive(:digest).and_return(digest_enabled)
30
30
  options
@@ -77,6 +77,7 @@ RSpec.describe Percy::Capybara::Loaders::SprocketsLoader do
77
77
  # Pretend like we're in a Rails app right now, all we care about is Rails.public_path.
78
78
  rails_double = double('Rails')
79
79
  # Pretend like the entire testdata directory is the public/ folder.
80
+ expect(rails_double).to receive(:application).and_return(nil)
80
81
  expect(rails_double).to receive(:public_path).and_return(environment.root + '/public')
81
82
  expect(loader).to receive(:_rails).at_least(:once).and_return(rails_double)
82
83
  end
@@ -40,7 +40,7 @@ module TestHelpers
40
40
  environment.append_path '.'
41
41
 
42
42
  sprockets_options = double('sprockets_options')
43
- allow(sprockets_options).to receive(:precompile).and_return([/(?:\/|\\|\A)base\.(css|js)$/])
43
+ allow(sprockets_options).to receive(:precompile).and_return([%r{(?:/|\\|\A)base\.(css|js)$}])
44
44
  allow(sprockets_options).to receive(:digest).and_return(false)
45
45
 
46
46
  capybara_client.sprockets_environment = environment
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percy-capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perceptual Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-25 00:00:00.000000000 Z
11
+ date: 2017-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: percy-client