dchelimsky / rspec-tmbundle
- Source
- Commits
- Network (31)
- Issues (3)
- Downloads (4)
- Wiki (1)
- Graphs
-
Branch:
master
-
When trying to create a spec file for a model via CTRL-SHIFT-DOWN, it fails in line 99 of said script with "in 'klass': undefined method '+' for nil:NilClass (NoMethodError)". This is due to the fact that file_type in the routine content_for is set to "something spec", (here: "model spec"), not "spec":
def content_for(file_type, relative_path)
case file_type when 'spec' then spec(relative_path) else klass(relative_path) end endNow, looking at the routine that calls content_for, go_to_twin, line 9ff, it calls file_type() [line 23ff], which returns return "#{$3[0..-2]} spec" if the other file (the "twin", in this case, as we are creating a spec for the model) contains "spec" and other stuff in the path (see regex there). In general, file_type can return "something spec", "something", "spec", or "file". This is not what content_for expects, and file_type is called by this script only from this line in go_to_twin. So there is this proposed fix in content_for() by always looking at the last word in file_type:
def content_for(file_type, relative_path)
case file_type.split[-1] when 'spec' then spec(relative_path) else klass(relative_path) end endComments
-
Comments
The old version did require File.dirname(FILE) + '/../../../spec_helper'
That works in namespaced specs
The new version fails.
dchelimsky
Wed Oct 07 19:14:14 -0700 2009
| link
Have you updated to rspec 1.2.9?
dchelimsky
Thu Oct 08 05:49:47 -0700 2009
| link
Closing this as all is well w/ 1.2.9
@dchelimsky - Is this true? I'm on 1.2.9 with the latest rspec-tmbundle and getting LoadErrors with "no such file to load — spec_helper".
annnnnnnd just kidding. The ol' *_spec-file-using-the-wrong-bundle issue. Once I manually set it to use the RSpec bundle it picked up the correct commands to use. Wicked.
tilsammans
Thu Dec 10 18:28:35 -0800 2009
| link
What is the "The ol' *_spec-file-using-the-wrong-bundle issue" ? I have the problem described and would very much to fix it.
-
Running specs in standalone mode raises error
3 comments Created about 1 month ago by rhunterApparently rspec-tmbundle raises a "non-obvious" error to the user if you hit ⌘R without a project open:
Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate.rb:4:in `join': can't convert nil into String (TypeError)
I suppose that it should either work just fine, or not be an option (Run is disabled). Worst-case, it could raise a more obvious error message.
I spotted the problem on a blog:
http://patforna.blogspot.com/2009/11/rspec-and-textmate.htmlI plan on giving this a crack this evening, but I'm logging an issue in case I get distracted (or perhaps find that hacking on textmate bundles is beyond me? ;-) )
Comments
dchelimsky
Wed Nov 18 12:03:25 -0800 2009
| link
A patch would be welcome. If you can get it to just work, that's great, but I'm not sure how to make that happen. If not that, either other option is fine with me.
Thanks.
Fix:
http://github.com/grimen/rspec-tmbundle/commit/e3951fd6bbbe204b6089d3101decd5687dd26c88
I won't file a Lighthouse ticket because I dont' got account there - and won't get one.
dchelimsky
Thu Dec 03 04:48:43 -0800 2009
| link
Merged. Thanks.
-
I did a sudo gem install rspec and cloned the git repository of this bundle as per the instructions.
I have a .rb file and a _spec.rb that run fine from the console but when I press cmd-R with the _spec file opened on Textmate, I get the following error:
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- spec/autorun (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from /Users/vrinek/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate.rb:14 from /tmp/textmate-command-1935.rb:2:in `require' from /tmp/textmate-command-1935.rb:2Almost the same error appears in a tootltip when I save the _spec.rb file
Comments
humblehacker
Thu Aug 20 09:57:50 -0700 2009
| link
Same problem here. Interesting to note that I'm using ruby 1.9, i.e. my TM_RUBY var is set to point to ruby1.9, yet the error message points to 1.8.
humblehacker
Thu Aug 20 15:58:29 -0700 2009
| link
Wait, I have not set my TM_RUBY to anything and I don't even have 1.9 installed...
humblehacker
Mon Aug 24 04:35:33 -0700 2009
| link
Interesting. Perhaps it's a different problem for you. Is the ruby executable called from within TextMate the same as the one from the command line? If they're different, you might need to set you PATH var inside TextMate.
In case you need help finding out: Open a new TextMate file, type 'which ruby', and press Ctrl-r. Compare this result with 'which ruby' executed from the command line.
-
When I create a new spec file in rails using control-shift-down, the spec file is created but it is empty. The template shows up in a new, unsaved file that is not part of the project.
TextMate 1.5.8 (1509) and Rspec 1.2.9
I'm using the latest rspec-tmbundle from github.
Comments
Also, the require does not give the path to the spec_helper
tilsammans
Thu Dec 10 18:27:31 -0800 2009
| link
I have this same problem.
-
Rails has changed application.rb to application_controller.rb =>
http://github.com/agibralter/rspec-tmbundle/commit/0a791e5db51d4a15df980022880e699e52daea9a
Comments





Are you using the official textmate bundle or the one in git? The bundle in git already uses when /spec$/ (which effectively does the same thing you're describing)..
I'm using the official bundle, I guess (from svn).
That bundle is super out of date - I need to get it updated, but in the mean time you can grab the bundle from git per http://wiki.github.com/dchelimsky/rspec/textmate.
>