Permalink
Browse files

Simplify RSpec require

Also enhance RubyClassNameFromFilename to strip out _spec suffixes.
  • Loading branch information...
1 parent 8e61929 commit f8e281cfa24b67d8886317bf71368c7210eb4836 @mikem mikem committed Nov 10, 2010
Showing with 3 additions and 3 deletions.
  1. +2 −2 ruby-rspec/desc.snippet
  2. +1 −1 support_functions.vim
View
4 ruby-rspec/desc.snippet
@@ -1,5 +1,5 @@
-require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require 'spec_helper'
-describe ${1:controller} do
+describe ${1:`Snippet_RubyClassNameFromFilename()`} do
${2}
end
View
2 support_functions.vim
@@ -8,7 +8,7 @@ function! Snippet_RubyClassNameFromFilename(...)
let name = a:1
endif
endif
- return Snippet_Camelcase(name)
+ return Snippet_Camelcase(substitute(name, '_spec$', '', ''))
endfunction
function! Snippet_MigrationNameFromFilename(...)

0 comments on commit f8e281c

Please sign in to comment.