public
Description: Textmate bundle for RSpec.
Homepage:
Clone URL: git://github.com/dchelimsky/rspec-tmbundle.git
Patch from Ryan Carmelo Briones to map alternate file for application.rb to 
application_controller_spec.rb. [#396 state:resolved]
David Chelimsky (author)
Tue Aug 05 02:05:25 -0700 2008
commit  8b3bc99c3211b3b319ea5e58faa67013481a197c
tree    7c52086a4975796b3cf04e72690daec2de2e1d98
parent  8f272f25dba38766663753cc419a1187879fc6fb
...
26
27
28
 
29
30
31
...
39
40
41
 
 
 
42
43
44
...
26
27
28
29
30
31
32
...
40
41
42
43
44
45
46
47
48
0
@@ -26,6 +26,7 @@ module Spec
0
               if rails?(prefix)
0
                 path = path.gsub(/\/app\//, "/spec/")
0
                 path = path.gsub(/\/lib\//, "/spec/lib/")
0
+                path = path.gsub(/application/, 'application_controller')
0
               else
0
                 path = path.gsub(/\/lib\//, "/spec/")
0
               end
0
@@ -39,6 +40,9 @@ module Spec
0
               if rails?(prefix)
0
                 path = path.gsub(/\/spec\/lib\//, "/lib/")
0
                 path = path.gsub(/\/spec\//, "/app/")
0
+                if File.basename(path) == 'application_controller.rb'
0
+                  path = path.gsub(/_controller/, "")
0
+                end
0
               else
0
                 path = path.gsub(/\/spec\//, "/lib/")
0
               end
...
116
117
118
 
 
 
 
 
 
 
 
 
 
119
120
121
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
0
@@ -116,6 +116,16 @@ EOF
0
         "/a/full/path/app/controllers/mooky_controller.rb".should twin(
0
         "/a/full/path/spec/controllers/mooky_controller_spec.rb")
0
       end
0
+      
0
+      it do
0
+        "/a/full/path/app/controllers/application.rb".should twin(
0
+        "/a/full/path/spec/controllers/application_controller_spec.rb")
0
+      end
0
+      
0
+      it do
0
+        "/a/full/path/spec/controllers/application_controller_spec.rb".should twin(
0
+        "/a/full/path/app/controllers/application.rb")
0
+      end
0
 
0
       it do
0
         "/a/full/path/app/models/mooky.rb".should twin(

Comments