capybara-screenshot 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ 2 December 2011
2
+ ---------------
3
+
4
+ Fixed bug related to teardown hook not being available in Minitest for some reason (possibly version issues).
5
+ https://github.com/mattheworiordan/capybara-screenshot/issues/5
6
+
1
7
  24 November 2011
2
8
  ----------------
3
9
 
@@ -1,12 +1,26 @@
1
1
  require 'capybara-screenshot/saver'
2
2
 
3
3
  if defined?(ActionDispatch::IntegrationTest)
4
- ActionDispatch::IntegrationTest.add_teardown_hook do |context|
5
- # by adding the argument context, MiniTest passes the context of the test
6
- # which has an instance variable @passed indicating success / failure
7
- context.instance_eval do
8
- if @passed.blank?
9
- Capybara::Screenshot::Saver.screen_shot_and_save_page Capybara, Capybara.body
4
+ # older versions of Minitest support add_tear_downhook
5
+ if defined?(ActionDispath::IntegrationTest.add_teardown_hook)
6
+ ActionDispatch::IntegrationTest.add_teardown_hook do |context|
7
+ # by adding the argument context, MiniTest passes the context of the test
8
+ # which has an instance variable @passed indicating success / failure
9
+ context.instance_eval do
10
+ if @passed.blank?
11
+ Capybara::Screenshot::Saver.screen_shot_and_save_page Capybara, Capybara.body
12
+ end
13
+ end
14
+ end
15
+ else
16
+ # new since 2.8.1 use after instead of add_tear_downhook
17
+ ActionDispatch::IntegrationTest.after do |context|
18
+ # by adding the argument context, MiniTest passes the context of the test
19
+ # which has an instance variable @passed indicating success / failure
20
+ context.instance_eval do
21
+ if @passed.blank?
22
+ Capybara::Screenshot::Saver.screen_shot_and_save_page Capybara, Capybara.body
23
+ end
10
24
  end
11
25
  end
12
26
  end
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Screenshot
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-screenshot
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthew O'Riordan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-24 00:00:00 +00:00
18
+ date: 2011-12-02 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency