capybara-screenshot 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +6 -0
- data/lib/capybara-screenshot/minitest.rb +20 -6
- data/lib/capybara-screenshot/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,26 @@
|
|
1
1
|
require 'capybara-screenshot/saver'
|
2
2
|
|
3
3
|
if defined?(ActionDispatch::IntegrationTest)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
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:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
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-
|
18
|
+
date: 2011-12-02 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|