percy-capybara 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/percy/capybara.rb +9 -1
- data/lib/percy/capybara/client.rb +4 -0
- data/lib/percy/capybara/version.rb +1 -1
- data/spec/lib/percy/capybara_spec.rb +11 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ec1811094152205c30db1c67c183b14e85d3a52
|
4
|
+
data.tar.gz: 039f35ab33a64b6b14d0d3328da291a824b9e0c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acd5e2f499016bbcf3e9fcd1321d2a601258117ba275553dc600502dfb32a13dffe8c9ad6189748738562d37372df781586f5472aec6c071a1e0dca1139fba7b
|
7
|
+
data.tar.gz: d3ec4106d244bdffb26f7a79506e42b291df27a92e4f53f939835f117cba4e3e95105c9f4f0a6e4f1dd3da249608b882865d79ed5bc4d70cdaa8a9a963077df4
|
data/lib/percy/capybara.rb
CHANGED
@@ -41,8 +41,16 @@ module Percy
|
|
41
41
|
end
|
42
42
|
|
43
43
|
# Reset the global Percy::Capybara module state.
|
44
|
-
def self.reset
|
44
|
+
def self.reset!
|
45
45
|
@capybara_client = nil
|
46
46
|
end
|
47
|
+
# The 'reset' method is deprecated and will be removed: use the reset! method instead.
|
48
|
+
class << self; alias_method :reset, :reset!; end;
|
49
|
+
|
50
|
+
# Manually disable Percy for the current capybara client. This can also be done with the
|
51
|
+
# PERCY_ENABLE=0 environment variable.
|
52
|
+
def self.disable!
|
53
|
+
capybara_client.disable!
|
54
|
+
end
|
47
55
|
end
|
48
56
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
RSpec.describe Percy::Capybara do
|
2
2
|
before(:each) do
|
3
|
-
Percy::Capybara.reset
|
3
|
+
Percy::Capybara.reset!
|
4
4
|
@original_env = ENV['TRAVIS_BUILD_ID']
|
5
5
|
ENV['PERCY_ENABLE'] = '1'
|
6
6
|
ENV['TRAVIS_BUILD_ID'] = nil
|
@@ -61,11 +61,19 @@ RSpec.describe Percy::Capybara do
|
|
61
61
|
Percy::Capybara.finalize_build
|
62
62
|
end
|
63
63
|
end
|
64
|
-
describe '#reset' do
|
64
|
+
describe '#reset!' do
|
65
65
|
it 'clears the current capybara_client' do
|
66
66
|
capybara_client = Percy::Capybara.capybara_client
|
67
|
-
Percy::Capybara.reset
|
67
|
+
Percy::Capybara.reset!
|
68
68
|
expect(Percy::Capybara.capybara_client).to_not eq(capybara_client)
|
69
69
|
end
|
70
70
|
end
|
71
|
+
describe '#disable!' do
|
72
|
+
it 'sets the current capybara_client to disabled' do
|
73
|
+
capybara_client = Percy::Capybara.capybara_client
|
74
|
+
expect(Percy::Capybara.capybara_client.enabled?).to eq(true)
|
75
|
+
Percy::Capybara.disable!
|
76
|
+
expect(Percy::Capybara.capybara_client.enabled?).to eq(false)
|
77
|
+
end
|
78
|
+
end
|
71
79
|
end
|
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.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: percy-client
|