capybara-screenshot 0.1.6 → 0.1.7
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 +7 -0
- data/lib/capybara-screenshot/minitest.rb +17 -19
- data/lib/capybara-screenshot/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
require 'capybara-screenshot/saver'
|
2
2
|
|
3
3
|
if defined?(ActionDispatch::IntegrationTest)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
4
|
+
method = if ActionDispatch::IntegrationTest.respond_to? :teardown
|
5
|
+
:teardown
|
6
|
+
elsif ActionDispatch::IntegrationTest.respond_to? :add_tear_down_hook
|
7
|
+
:add_tear_down_hook
|
8
|
+
end
|
9
|
+
|
10
|
+
unless method.nil?
|
11
|
+
begin
|
12
|
+
ActionDispatch::IntegrationTest.send method do |context|
|
13
|
+
# by adding the argument context, MiniTest passes the context of the test
|
14
|
+
# which has an instance variable @passed indicating success / failure
|
15
|
+
context.instance_eval do
|
16
|
+
if @passed.blank?
|
17
|
+
Capybara::Screenshot::Saver.screen_shot_and_save_page Capybara, Capybara.body
|
18
|
+
end
|
23
19
|
end
|
24
20
|
end
|
21
|
+
rescue NoMethodError
|
22
|
+
# do nothing, teardown for minitest not available
|
25
23
|
end
|
26
24
|
end
|
27
25
|
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: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 7
|
10
|
+
version: 0.1.7
|
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-12-
|
18
|
+
date: 2011-12-03 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|