visdiff 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/visdiff/minitest.rb +11 -0
- data/lib/visdiff/rspec.rb +33 -0
- data/lib/visdiff/test_run.rb +0 -11
- data/lib/visdiff/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4daa67bfcabb38bb0620106333b0472adeada9df
|
4
|
+
data.tar.gz: e4cdfe4b971ca342e812989a041f18d62be2979e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ef7919a3db337d3350c0bb160598661460e1d64e16fcc09e175cc08b5422988ae94912b38b775c2254df2978de62eccd3f7fae0545827c5d6678045bdef273c
|
7
|
+
data.tar.gz: ca4a48f44006536374771e830d076474958f0a310353069fa66db537260535ef789feedbe2dbe922d69cff246b3654a226debf46f3c16c57f43b99c0b522ec57
|
data/lib/visdiff/minitest.rb
CHANGED
@@ -7,6 +7,17 @@ module Visdiff::Minitest
|
|
7
7
|
mod.send(:define_method, :visdiff) { visdiff }
|
8
8
|
klass.send(:extend, mod)
|
9
9
|
klass.send(:include, mod)
|
10
|
+
|
11
|
+
submit_proc = lambda do
|
12
|
+
visduff.submit!
|
13
|
+
end
|
14
|
+
|
15
|
+
if Minitest.respond_to?(:after_run)
|
16
|
+
Minitest.after_run(&submit_proc)
|
17
|
+
else
|
18
|
+
# old, issues a warning on new versions of minitest
|
19
|
+
MiniTest::Unit.after_tests(&submit_proc)
|
20
|
+
end
|
10
21
|
end
|
11
22
|
|
12
23
|
def observe!(identifier)
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'visdiff/test_run'
|
2
|
+
|
3
|
+
require 'rspec/core'
|
4
|
+
|
5
|
+
module Visdiff::RSpec
|
6
|
+
def observe!(identifier)
|
7
|
+
visdiff.observe_page(identifier, page)
|
8
|
+
end
|
9
|
+
|
10
|
+
def visdiff
|
11
|
+
RSpec.configuration.visdiff
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
RSpec.configure do |c|
|
16
|
+
visdiff = Visdiff::TestRun.new
|
17
|
+
|
18
|
+
c.add_setting :visdiff
|
19
|
+
c.visdiff = visdiff
|
20
|
+
|
21
|
+
c.after(:each) do |example|
|
22
|
+
if example.exception && visdiff.enabled
|
23
|
+
warn "Disabling visdiff due to test failure"
|
24
|
+
visdiff.enabled = false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
c.after(:suite) do
|
29
|
+
visdiff.submit!
|
30
|
+
end
|
31
|
+
|
32
|
+
c.include Visdiff::RSpec
|
33
|
+
end
|
data/lib/visdiff/test_run.rb
CHANGED
@@ -13,17 +13,6 @@ class Visdiff::TestRun
|
|
13
13
|
visdiff = Visdiff::Client.new
|
14
14
|
@revision = visdiff.revision
|
15
15
|
@enabled = false
|
16
|
-
|
17
|
-
submit_proc = lambda do
|
18
|
-
submit!
|
19
|
-
end
|
20
|
-
|
21
|
-
if Minitest.respond_to?(:after_run)
|
22
|
-
Minitest.after_run(&submit_proc)
|
23
|
-
else
|
24
|
-
# old, issues a warning on new versions of minitest
|
25
|
-
MiniTest::Unit.after_tests(&submit_proc)
|
26
|
-
end
|
27
16
|
end
|
28
17
|
|
29
18
|
def submit!
|
data/lib/visdiff/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visdiff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Hawthorn
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/visdiff/image.rb
|
71
71
|
- lib/visdiff/minitest.rb
|
72
72
|
- lib/visdiff/revision.rb
|
73
|
+
- lib/visdiff/rspec.rb
|
73
74
|
- lib/visdiff/test_run.rb
|
74
75
|
- lib/visdiff/version.rb
|
75
76
|
- visdiff.gemspec
|