capybara-screenshot 0.3.10 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,23 +18,25 @@ module Capybara
18
18
  end
19
19
 
20
20
  def save_html
21
+ path = html_path
21
22
  clear_save_and_open_page_path do
22
23
  if Capybara::VERSION.match(/^\d+/)[0] == '1'
23
- capybara.save_page(page.body, "#{html_path}")
24
+ capybara.save_page(page.body, "#{path}")
24
25
  else
25
- capybara.save_page("#{html_path}")
26
+ capybara.save_page("#{path}")
26
27
  end
27
28
  end
28
- warn "Saved file #{html_path}"
29
+ warn "Saved file #{path}"
29
30
  end
30
31
 
31
32
  def save_screenshot
33
+ path = screenshot_path
32
34
  clear_save_and_open_page_path do
33
35
  Capybara.save_and_open_page_path = nil
34
36
  Capybara::Screenshot.registered_drivers.fetch(capybara.current_driver) { |driver_name|
35
37
  warn "capybara-screenshot could not detect a screenshot driver for '#{capybara.current_driver}'. Saving with default with unknown results."
36
38
  Capybara::Screenshot.registered_drivers[:default]
37
- }.call(page.driver, screenshot_path)
39
+ }.call(page.driver, path)
38
40
  end
39
41
  end
40
42
 
@@ -47,8 +49,8 @@ module Capybara
47
49
  end
48
50
 
49
51
  # If Capybara.save_and_open_page_path is set then
50
- # the html_path or screenshot_path will be appended to this path
51
- # instead of replacing it
52
+ # the html_path or screenshot_path can be appended to this path in
53
+ # some versions of Capybara instead of using it as an absolute path
52
54
  def clear_save_and_open_page_path
53
55
  old_path = Capybara.save_and_open_page_path
54
56
  Capybara.save_and_open_page_path = nil
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Screenshot
3
- VERSION = "0.3.10"
3
+ VERSION = "0.3.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-screenshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  segments:
109
109
  - 0
110
- hash: -2459750308362478257
110
+ hash: -4122417616762416045
111
111
  required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  none: false
113
113
  requirements:
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  segments:
118
118
  - 0
119
- hash: -2459750308362478257
119
+ hash: -4122417616762416045
120
120
  requirements: []
121
121
  rubyforge_project: capybara-screenshot
122
122
  rubygems_version: 1.8.24