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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 729292acdcd423e20d6c449c0e81e7485facccb9
4
- data.tar.gz: edde170cd99ffd76847feab2ce4c6fb63196a9a0
3
+ metadata.gz: 4daa67bfcabb38bb0620106333b0472adeada9df
4
+ data.tar.gz: e4cdfe4b971ca342e812989a041f18d62be2979e
5
5
  SHA512:
6
- metadata.gz: 25f240dcf7ac01dd2df634ab5d006000fce64c2c53315c43424bbebc852ba640565091a2ecf8358e58482ac8daa3dfda5499b9d8a4b863c7c17d824b58fcc32f
7
- data.tar.gz: 808306fada60b3492a28f95c2786e65b7ea4662af153adf0650963b3cfa6c4ea1d69d3014cc188e5f30bc07159b51c321248e670dd3d9160ffb4fb3ca936176f
6
+ metadata.gz: 6ef7919a3db337d3350c0bb160598661460e1d64e16fcc09e175cc08b5422988ae94912b38b775c2254df2978de62eccd3f7fae0545827c5d6678045bdef273c
7
+ data.tar.gz: ca4a48f44006536374771e830d076474958f0a310353069fa66db537260535ef789feedbe2dbe922d69cff246b3654a226debf46f3c16c57f43b99c0b522ec57
@@ -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
@@ -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!
@@ -1,3 +1,3 @@
1
1
  module Visdiff
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
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