Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

swapped use of for as the former seems not to exist on some versions …

…of emacs. (Oh yeah, and I added the first test.)
  • Loading branch information...
commit 813ac65b9ecfe3254c0da0833922e1ce358cd566 1 parent 1d5368c
authored April 28, 2008
9  rspec-mode-expectations.el
... ...
@@ -0,0 +1,9 @@
  1
+(require 'el-expectations)
  2
+(require 'rspec-mode)
  3
+
  4
+(expectations
  5
+ (desc "File name predicates")
  6
+ (expect (not nil)
  7
+   (rspec-spec-file-p "/foo/bar/baz_spec.rb"))
  8
+ (expect nil 
  9
+   (rspec-spec-file-p "/foo/bar/baz.rb")))
7  rspec-mode.el
@@ -29,7 +29,8 @@
29 29
 ;; Dependencies
30 30
 ;; ------------
31 31
 ;;
32  
-;; This minor mode depends on `mode-compile`.
  32
+;; This minor mode depends on `mode-compile`.  The expectations depend
  33
+;; `on el-expectataions.el`.
33 34
 ;; 
34 35
 ;;
35 36
 ;; (c) 2008 Peter Williams <http://pezra.barelyenough.org>
@@ -153,7 +154,7 @@
153 154
 (defun rspec-directory-subdirectories (directory)
154 155
   "Returns list of subdirectories"
155 156
   (remove-if 
156  
-   (lambda (dir) (or (string-match-p "^\\.\\.?$" (file-name-nondirectory dir)) 
  157
+   (lambda (dir) (or (string-match "^\\.\\.?$" (file-name-nondirectory dir)) 
157 158
                      (not (file-directory-p dir))))
158 159
    (directory-files directory t)))
159 160
 
@@ -177,7 +178,7 @@
177 178
 
178 179
 (defun rspec-spec-file-p (a-file-name)
179 180
   "Returns true if the specified file is a spec"
180  
-  (string-match-p "\\(_\\|-\\)spec\\.rb$" a-file-name))
  181
+  (string-match "\\(_\\|-\\)spec\\.rb$" a-file-name))
181 182
 
182 183
 (defun rspec-buffer-is-spec-p ()
183 184
   "Returns true if the current buffer is a spec"

0 notes on commit 813ac65

Please sign in to comment.
Something went wrong with that request. Please try again.