watirspec 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module WatiRspec
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -63,6 +63,23 @@ module Watir
63
63
  sleep @pause_after_wait unless no_sleep
64
64
  @down_load_time
65
65
  end
66
+
67
+ # Closes the browser even if #wait throws an exception.
68
+ # It happens mostly when #run_error_checks throws some exception.
69
+ def close
70
+ return unless exists?
71
+ @closing = true
72
+ @ie.stop
73
+ begin
74
+ wait
75
+ rescue
76
+ end
77
+ chwnd = @ie.hwnd.to_i
78
+ @ie.quit
79
+ while Win32API.new("user32", "IsWindow", 'L', 'L').Call(chwnd) == 1
80
+ sleep 0.3
81
+ end
82
+ end
66
83
  end
67
84
 
68
85
  module PageContainer #:nodoc:all
@@ -0,0 +1,13 @@
1
+ require "watirspec"
2
+ require "spec/autorun"
3
+
4
+ describe Watir::IE do
5
+
6
+ it "closes the browser even when Watir::IE#run_error_checks throws an exception" do
7
+ @browser.add_checker lambda {raise "let's fail IE#wait in IE#close"}
8
+ @browser.should exist
9
+ lambda {@browser.close}.should_not raise_exception
10
+ @browser.should_not exist
11
+ end
12
+
13
+ end
data/todo.txt CHANGED
@@ -1,2 +1,3 @@
1
1
  uus nime-idee - watirmelon
2
+ kui watir::wait viskab exceptioni, siis after :all-is browser.close ei tööta sellesama exceptioni pärast! ära fixida...
2
3
 
Binary file
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jarmo Pertman
@@ -149,6 +149,7 @@ files:
149
149
  - spec/spec_helper_spec.rb
150
150
  - spec/spec_match_array_spec.rb
151
151
  - spec/util_spec.rb
152
+ - spec/watir_ie_spec.rb
152
153
  - spec/watir_table_row_spec.rb
153
154
  - spec/watir_table_spec.rb
154
155
  - templates/common/config.rb
@@ -164,6 +165,7 @@ files:
164
165
  - watirspec-0.1.2.gem
165
166
  - watirspec-0.1.3.gem
166
167
  - watirspec-0.1.4.gem
168
+ - watirspec-0.1.5.gem
167
169
  has_rdoc: true
168
170
  homepage: http://github.com/jarmo/WatiRspec
169
171
  licenses: []
@@ -205,6 +207,6 @@ rubyforge_project:
205
207
  rubygems_version: 1.3.6
206
208
  signing_key:
207
209
  specification_version: 3
208
- summary: watirspec 0.1.5
210
+ summary: watirspec 0.1.6
209
211
  test_files: []
210
212