Skip to content

Instantly share code, notes, and snippets.

View futuremint's full-sized avatar

Dave Woodward futuremint

  • AED
  • Bozeman, MT
View GitHub Profile
@futuremint
futuremint / really_hackish_spec_to_shoulda.el
Created April 20, 2009 20:50 — forked from jnunemaker/really_hackish_spec_to_shoulda.rb
Translates RSpec to Shoulda in your current Emacs buffer (tested in GNU Emacs only)
(defun rspec-to-shoulda ()
"Translates RSpec code to Shoulda
NOTE: You still have to wrap the results in a Test::Unit class"
(interactive)
(dolist (pair '(("\\(require\s.*/\\)\\([a-z_]+\\)'$" "\\1test_helper'") ;; require
("describe\s" "context ") ;; RSpec -> Shoulda syntax
("it\s" "should ")
("\s\"should\s" " \"")
("before\s" "setup ")
("before(:each)\s" "setup ")