public
Fork of dchelimsky/rspec-rails
Description: RSpec's official Ruby on Rails plugin
Homepage:
Clone URL: git://github.com/ianwhite/rspec-rails.git
Fix for #516: isolation_mode not working because of API change for pick_template
ianwhite (author)
Wed Sep 03 04:13:03 -0700 2008
commit  abdb570870467409c1fd05af751a8c3cb2964fed
tree    5f844a29aeaee8ec56a9377a130db753edba2665
parent  e11c5b58f1a85dbd260bca96410740c12fda21f4
...
195
196
197
198
 
 
 
 
 
 
 
 
199
200
201
...
195
196
197
 
198
199
200
201
202
203
204
205
206
207
208
0
@@ -195,7 +195,14 @@ module Spec
0
                     @first_render ||= args[0] unless args[0] =~ /^layouts/
0
                   end
0
                   
0
-                  define_method :pick_template do |*args|
0
+                  # BC branching code: in Rails #6f932b4 :pick_template became :_pick_template
0
+                  pick_template_method_name = if ::ActionView::Base.instance_methods.include?('_pick_template')
0
+                    :_pick_template
0
+                  else
0
+                    :pick_template
0
+                  end
0
+                  
0
+                  define_method pick_template_method_name do |*args|
0
                     @_first_render ||= args[0] unless args[0] =~ /^layouts/
0
                     PickedTemplate.new
0
                   end

Comments