capybara-screenshot 0.3.4 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/README.md +9 -3
- data/capybara-screenshot.gemspec +6 -1
- data/lib/capybara-screenshot.rb +3 -4
- data/lib/capybara-screenshot/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -83,10 +83,16 @@ Custom screenshot filename
|
|
83
83
|
If you want to control the screenshot filename for a specific test libarary, to inject the test name into it for example,
|
84
84
|
you can override how the basename is generated for the file like so
|
85
85
|
|
86
|
-
|
87
|
-
"
|
86
|
+
Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example|
|
87
|
+
"screenshot_#{example.description.gsub(' ', '-').gsub(/^.*\/spec\//,'')}"
|
88
88
|
end
|
89
|
-
|
89
|
+
|
90
|
+
Custom screenshot directory
|
91
|
+
--------------------------
|
92
|
+
By default screenshots are saved to the current working directory. If you want to customize the location, override the file path as:
|
93
|
+
|
94
|
+
Capybara.save_and_open_page_path = "/file/path"
|
95
|
+
|
90
96
|
|
91
97
|
Screenshot path in RSpec metadata
|
92
98
|
---------------------------------
|
data/capybara-screenshot.gemspec
CHANGED
@@ -14,7 +14,12 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.rubyforge_project = "capybara-screenshot"
|
16
16
|
|
17
|
-
|
17
|
+
if RUBY_VERSION < "1.9"
|
18
|
+
s.add_dependency 'capybara', ['>= 1.0', '< 2']
|
19
|
+
else
|
20
|
+
s.add_dependency 'capybara', ['>= 1.0', '< 3']
|
21
|
+
end
|
22
|
+
|
18
23
|
s.add_development_dependency 'rspec', '~> 2.7'
|
19
24
|
s.add_development_dependency 'timecop'
|
20
25
|
|
data/lib/capybara-screenshot.rb
CHANGED
@@ -43,13 +43,12 @@ module Capybara
|
|
43
43
|
#If the path isn't set, default to the current directory
|
44
44
|
capybara_tmp_path = Capybara.save_and_open_page_path || '.'
|
45
45
|
|
46
|
-
@capybara = if defined?(Rails)
|
47
|
-
Rails.root.join capybara_tmp_path
|
46
|
+
@capybara = if defined?(::Rails)
|
47
|
+
::Rails.root.join capybara_tmp_path
|
48
48
|
elsif defined?(Padrino)
|
49
49
|
Padrino.root capybara_tmp_path
|
50
50
|
elsif defined?(Sinatra)
|
51
|
-
|
52
|
-
File.join(settings.root, capybara_tmp_path)
|
51
|
+
File.join(Sinatra::Application.root, capybara_tmp_path)
|
53
52
|
else
|
54
53
|
capybara_tmp_path
|
55
54
|
end.to_s
|
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.
|
4
|
+
version: 0.3.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capybara
|
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
segments:
|
109
109
|
- 0
|
110
|
-
hash:
|
110
|
+
hash: 3211411598851201235
|
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:
|
119
|
+
hash: 3211411598851201235
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project: capybara-screenshot
|
122
122
|
rubygems_version: 1.8.24
|