public
Description: Webrat - Ruby Acceptance Testing for Web applications
Homepage: http://gitrdoc.com/brynary/webrat/tree/master/
Clone URL: git://github.com/brynary/webrat.git
Fix startup bug when using Webrat::Selenium with Test::Unit
brynary (author)
Sat Dec 27 11:05:19 -0800 2008
commit  362df8abf0f0930ee95fa0b8a708191afa57578e
tree    ad4f68a92a9d4a22095c96169e231a1598182546
parent  2bf3c0aaa33cb7618556ed403c785032ace0fcbf
...
6
7
8
9
 
10
11
 
 
 
 
 
12
13
14
...
6
7
8
 
9
10
 
11
12
13
14
15
16
17
18
0
@@ -6,9 +6,13 @@
0
   * Removed auto-require of webrat/rails when requiring webrat when RAILS_ENV is
0
     defined
0
   
0
-  In your env.rb file, ensure you have:
0
+  In your env.rb or test_helper.rb file, ensure you have something like:
0
   
0
-    require "webrat/rails"
0
+    require "webrat"
0
+    
0
+    Webrat.configure do |config|
0
+      config.mode = :rails
0
+    end
0
   
0
 * Major enhancements
0
 
...
59
60
61
62
 
63
64
65
...
59
60
61
 
62
63
64
65
0
@@ -59,7 +59,7 @@ To install the latest code as a plugin: (_Note:_ This may be less stable than us
0
 
0
   script/plugin install git://github.com/brynary/webrat.git
0
 
0
-In your test_helper.rb, spec_helper.rb, or env.rb (for Cucumber) add:
0
+In your test_helper.rb or env.rb (for Cucumber) add:
0
 
0
   require "webrat"
0
   
...
38
39
40
41
42
43
44
45
46
47
48
 
 
 
 
49
50
51
...
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
 
 
 
 
 
 
 
 
91
92
93
94
 
 
95
96
97
98
99
100
101
102
103
 
 
104
105
...
38
39
40
 
 
 
 
 
 
 
 
41
42
43
44
45
46
47
...
68
69
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
72
73
74
75
76
77
78
79
 
 
 
80
81
82
83
84
 
85
86
87
88
89
90
91
92
93
0
@@ -38,14 +38,10 @@ module Webrat
0
   # To use Webrat's Selenium support, you'll need the selenium-client gem installed.
0
   # Activate it with (for example, in your <tt>env.rb</tt>):
0
   #
0
-  #   require "webrat/selenium"
0
-  # 
0
-  # Then, if you're using Cucumber, configure it to use a 
0
-  # <tt>Webrat::Selenium::Rails::World</tt> as the scenario context by adding
0
-  # the following to <tt>env.rb</tt>:
0
-  #
0
-  #   World do
0
-  #     Webrat::Selenium::Rails::World.new
0
+  #   require "webrat"
0
+  #   
0
+  #   Webrat.configure do |config|
0
+  #     config.mode = :selenium
0
   #   end
0
   #
0
   # == Dropping down to the selenium-client API
0
@@ -72,34 +68,26 @@ module Webrat
0
   # your Webrat::Selenium tests ignoring the concurrency issues that can plague in-browser
0
   # testing, so long as you're using the Webrat API.
0
   module Selenium
0
-    
0
-    module Rails #:nodoc:
0
-      class World < ::ActionController::IntegrationTest
0
-        include Webrat::Selenium::Matchers
0
-        
0
-        def initialize #:nodoc:
0
-          @_result = Test::Unit::TestResult.new
0
-        end
0
-        
0
-        def response
0
-          webrat_session.response
0
-        end
0
-        
0
-        def wait_for(*args, &block)
0
-          webrat_session.wait_for(*args, &block)
0
-        end
0
+    module Methods
0
+      def response
0
+        webrat_session.response
0
+      end
0
+
0
+      def wait_for(*args, &block)
0
+        webrat_session.wait_for(*args, &block)
0
+      end
0
 
0
-        def save_and_open_screengrab
0
-          webrat_session.save_and_open_screengrab
0
-        end
0
+      def save_and_open_screengrab
0
+        webrat_session.save_and_open_screengrab
0
       end
0
     end
0
   end
0
-    
0
 end
0
 
0
 module ActionController #:nodoc:
0
   IntegrationTest.class_eval do
0
     include Webrat::Methods
0
+    include Webrat::Selenium::Methods
0
+    include Webrat::Selenium::Matchers
0
   end
0
 end

Comments