<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -152,7 +152,9 @@ module Webrat
         begin
           value = yield
         rescue Exception =&gt; e
-          raise e unless yieldable_exceptions.include?(e.class)
+          unless is_ignorable_wait_for_exception?(e)
+            raise e
+          end
         end
 
         return value if value
@@ -187,14 +189,13 @@ module Webrat
 
     end
 
-    def yieldable_exceptions
-      return [::Selenium::CommandError, Webrat::WebratError] unless lib_defined?(::Spec::Expectations::ExpectationNotMetError)
-      [::Spec::Expectations::ExpectationNotMetError, ::Selenium::CommandError, Webrat::WebratError]
-    end
-
     protected
-    def lib_defined?(library)
-      defined?(library)
+    def is_ignorable_wait_for_exception?(exception) #:nodoc:
+      if defined?(::Spec::Expectations::ExpectationNotMetError)
+        return true if exception.class == ::Spec::Expectations::ExpectationNotMetError
+      end
+      return true if [::Selenium::CommandError, Webrat::WebratError].include?(exception.class)
+      return false
     end
 
     def setup #:nodoc:</diff>
      <filename>lib/webrat/selenium/selenium_session.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,19 +10,9 @@ describe Webrat::SeleniumSession do
     @selenium = Webrat::SeleniumSession.new()
   end
 
-  it &quot;should provide a list yieldable exceptions without spec if spec isn't defined&quot; do
-    @selenium.should_receive(:lib_defined?).with(::Spec::Expectations::ExpectationNotMetError).and_return(false)
-    @selenium.yieldable_exceptions.should == [::Selenium::CommandError, Webrat::WebratError]
-  end
-
-  it &quot;should provide a list yieldable exceptions with rspec&quot; do
-    @selenium.should_receive(:lib_defined?).with(::Spec::Expectations::ExpectationNotMetError).and_return(true)
-    @selenium.yieldable_exceptions.should == [::Spec::Expectations::ExpectationNotMetError, ::Selenium::CommandError, Webrat::WebratError]
-  end
-
   it &quot;should throw timeout instead of spec expectionnotmet error&quot; do
     lambda {
-      @selenium.wait_for(:timeout =&gt; 0.1) do
+      @selenium.wait_for(:timeout =&gt; 0.0001) do
         raise ::Spec::Expectations::ExpectationNotMetError
       end
     }.should raise_error(Webrat::TimeoutError)
@@ -30,7 +20,7 @@ describe Webrat::SeleniumSession do
 
   it &quot;should throw timeout instead of selenium command error&quot; do
     lambda {
-      @selenium.wait_for(:timeout =&gt; 0.1) do
+      @selenium.wait_for(:timeout =&gt; 0.0001) do
         raise ::Selenium::CommandError
       end
     }.should raise_error(Webrat::TimeoutError)
@@ -38,7 +28,7 @@ describe Webrat::SeleniumSession do
 
   it &quot;should throw timeout instead of webrat error&quot; do
     lambda {
-      @selenium.wait_for(:timeout =&gt; 0.1) do
+      @selenium.wait_for(:timeout =&gt; 0.0001) do
         raise Webrat::WebratError.new
       end
     }.should raise_error(Webrat::TimeoutError)</diff>
      <filename>spec/public/selenium/selenium_session_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dd8688f371fae494e3fa070f272342d9b2c5f2fa</id>
    </parent>
  </parents>
  <author>
    <name>Mike Gaffney</name>
    <email>mike.gaffney@asolutions.com</email>
  </author>
  <url>http://github.com/brynary/webrat/commit/6bfdcc54cc82b23d268987e758d7676db1061fee</url>
  <id>6bfdcc54cc82b23d268987e758d7676db1061fee</id>
  <committed-date>2009-06-05T11:51:55-07:00</committed-date>
  <authored-date>2009-06-05T11:50:39-07:00</authored-date>
  <message>Fixed Spec in Test Unit more thoroghly</message>
  <tree>a56717f733b25a95fd627a8205f0474328ad57b3</tree>
  <committer>
    <name>Mike Gaffney</name>
    <email>mike.gaffney@asolutions.com</email>
  </committer>
</commit>
