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.
@@ -16,7 +16,7 @@ Spec::Runner.configure do |config|
16
16
  end
17
17
 
18
18
  config.after(:each) do
19
- Spec::Ui::ScreenshotFormatter.browser = @browser
19
+ Spec::Ui::ScreenshotFormatter.take_screenshot_of(@browser)
20
20
  end
21
21
 
22
22
  config.after(:all) do
@@ -13,7 +13,7 @@ Spec::Runner.configure do |config|
13
13
  end
14
14
 
15
15
  config.after(:each) do
16
- Spec::Ui::ScreenshotFormatter.browser = @browser
16
+ Spec::Ui::ScreenshotFormatter.take_screenshot_of(@browser)
17
17
  end
18
18
 
19
19
  config.after(:all) do
@@ -23,4 +23,6 @@ describe "Google's search page" do
23
23
  @browser.button(:name, "btnG").click
24
24
  @browser.should_not have_text("Ali G")
25
25
  end
26
+
27
+ it "should do something we haven't done yet"
26
28
  end
@@ -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 browser=(browser)
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! or #{self.name}.browser = @browser from after(:each)" if @png_path.nil?
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(img_path)
22
+ img.write(png_path)
23
23
  nil
24
24
  rescue Magick::ImageMagickError => e
25
25
  if e.message =~ /Insufficient image data in file/
@@ -3,7 +3,7 @@ module Spec
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
5
  MINOR = 2
6
- TINY = 2
6
+ TINY = 3
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
9
9
  end
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.2
7
- date: 2007-05-18 00:00:00 -07:00
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