spec_ui 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/spec/ui/formatter.rb
CHANGED
@@ -14,20 +14,20 @@ module Spec
|
|
14
14
|
# This method calls #screenshot! so that method should not be called
|
15
15
|
# when this method is used.
|
16
16
|
# This method *must* be called in an after(:each) block.
|
17
|
-
def
|
18
|
-
screenshot
|
17
|
+
def take_screenshot_of(browser)
|
18
|
+
screenshot
|
19
19
|
@html = browser.html
|
20
20
|
end
|
21
21
|
|
22
22
|
# Takes a screenshot of the current window. Use this method when
|
23
23
|
# you don't have a browser object.
|
24
|
-
def screenshot
|
24
|
+
def screenshot
|
25
25
|
@png_path = Tempfile.new("spec:ui").path
|
26
26
|
save_screenshot(png_path)
|
27
27
|
end
|
28
28
|
|
29
29
|
def png_path
|
30
|
-
raise "Screenshot not taken. You must call #{self.name}.screenshot
|
30
|
+
raise "Screenshot not taken. You must call #{self.name}.screenshot or #{self.name}.take_screenshot_of(@browser) from after(:each)" if @png_path.nil?
|
31
31
|
@png_path
|
32
32
|
end
|
33
33
|
|
@@ -19,7 +19,7 @@ module Spec
|
|
19
19
|
width, height, bmp = ::Win32::Screenshot.foreground
|
20
20
|
begin
|
21
21
|
img = Magick::Image.from_blob(bmp)[0]
|
22
|
-
img.write(
|
22
|
+
img.write(png_path)
|
23
23
|
nil
|
24
24
|
rescue Magick::ImageMagickError => e
|
25
25
|
if e.message =~ /Insufficient image data in file/
|
data/lib/spec/ui/version.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: spec_ui
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2007-05-
|
6
|
+
version: 0.2.3
|
7
|
+
date: 2007-05-24 00:00:00 +02:00
|
8
8
|
summary: Run UI RSpec examples with screenshot reports
|
9
9
|
require_paths:
|
10
10
|
- lib
|