public
Fork of dchelimsky/rspec
Description: Behaviour Driven Development framework for Ruby
Homepage: http://rspec.info
Clone URL: git://github.com/martinbtt/rspec.git
Applied patch from Mike Williams to support the lib directory in rails 
apps with the Textmate Alternate File command. Closes #276.


git-svn-id: svn+ssh://rubyforge.org/var/svn/rspec/trunk@3299 
410327ef-2207-0410-a325-f78bbcb22a5a
dchelimsky (author)
Mon Feb 11 17:09:30 -0800 2008
commit  6f68f058d8974a29509948a8d9f06438bba49380
tree    536ad083046ba951de5d29257178c5ce5a3a9a36
parent  09e5a68667dd714f04db451b6a861df6e633531d
...
23
24
25
26
27
 
 
 
 
 
 
28
29
30
31
32
33
34
35
36
 
 
 
 
 
 
37
38
39
...
23
24
25
 
 
26
27
28
29
30
31
32
33
34
35
 
36
37
38
 
39
40
41
42
43
44
45
46
47
0
@@ -23,17 +23,25 @@ module Spec
0
           
0
           case parent
0
             when 'lib', 'app' then
0
- path = path.gsub(/\/app\//, "/spec/")
0
- path = path.gsub(/\/lib\//, "/spec/")
0
+ if rails?(prefix)
0
+ path = path.gsub(/\/app\//, "/spec/")
0
+ path = path.gsub(/\/lib\//, "/spec/lib/")
0
+ else
0
+ path = path.gsub(/\/lib\//, "/spec/")
0
+ end
0
               path = path.gsub(/\.rb$/, "_spec.rb")
0
               path = path.gsub(/\.erb$/, ".erb_spec.rb")
0
               path = path.gsub(/\.rhtml$/, ".rhtml_spec.rb")
0
             when 'spec' then
0
- new_parent = rails?(prefix) ? "app" : "lib"
0
               path = path.gsub(/\.rhtml_spec\.rb$/, ".rhtml")
0
               path = path.gsub(/\.erb_spec\.rb$/, ".erb")
0
               path = path.gsub(/_spec\.rb$/, ".rb")
0
- path = path.gsub(/\/spec\//, "/#{new_parent}/")
0
+ if rails?(prefix)
0
+ path = path.gsub(/\/spec\/lib\//, "/lib/")
0
+ path = path.gsub(/\/spec\//, "/app/")
0
+ else
0
+ path = path.gsub(/\/spec\//, "/lib/")
0
+ end
0
           end
0
           return path
0
         end
...
137
138
139
 
 
 
 
 
140
141
142
...
137
138
139
140
141
142
143
144
145
146
147
0
@@ -137,6 +137,11 @@ EOF
0
         "/a/full/path/spec/views/mooky/show.rhtml_spec.rb")
0
       end
0
       
0
+ it "should work with lib dir in rails" do
0
+ "/a/full/path/lib/foo/mooky.rb".should twin(
0
+ "/a/full/path/spec/lib/foo/mooky_spec.rb")
0
+ end
0
+
0
       it "should suggest controller spec" do
0
         "/a/full/path/spec/controllers/mooky_controller_spec.rb".should be_a("controller spec")
0
       end
...
291
292
293
 
294
295
296
...
291
292
293
294
295
296
297
0
@@ -291,6 +291,7 @@ In alphabetical order (by last name)
0
 ** Patch LH[#271] Since @template.finder, isolation mode doesn't work
0
 ** Patch for [#11545] Rspec doesn't handle should_receive on ActiveRecord associations
0
 * Mike Williams
0
+** Patch LH[#276] to support the lib directory in rails apps with the Textmate Alternate File command.
0
 ** Core patches for arbitrary comparisons like 5.should_be < 6
0
 * Chad Wooley
0
 ** Patch to mocks to make it possible to specify raised exception instance
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 == Version 1.1.4 (trunk)
0
 
0
+* Applied patch from Mike Williams to support the lib directory in rails apps with the Textmate Alternate File command. Closes #276.
0
 * Applied patch from Bob Cotton: Nested ExampleGroups do not have a spec_path. Closes #224.
0
 * Applied patch from Wincent Colaiuta to invert sense of "spec --diff". Closes #281.
0
 * Allow any type of render in view specs. Closes #57.

Comments

    No one has commented yet.