Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #3 from Benibur/feature/mocha-detect-filename-star…

…ting-with-test

MochaDetectFileTypeCommand validates files in ./testXXXXX/
  • Loading branch information...
commit 7fb80196f673b6573a9c9b3e30847b45c348302d 2 parents bf91357 + 38d5281
Lennart Melzer authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  DetectMochaTest.py
4  DetectMochaTest.py
@@ -12,8 +12,8 @@ def on_load(self, view):
12 12
       return
13 13
 
14 14
     name = os.path.basename(filename.lower())
15  
-    dirname = os.path.dirname(filename.lower())
16  
-    if dirname[-4:] == "test":
  15
+    dirname = os.path.dirname(filename.lower()).rpartition('/')[2]
  16
+    if dirname[:4] == "test":
17 17
       set_syntax(view, "Mocha", "Mocha")
18 18
 
19 19
 

0 notes on commit 7fb8019

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