# -*- coding: utf-8 -*-

import sys
import os
import imp

from mamba import formatters
from mamba.runner import Runner


def main():
    formatter = formatters.DocumentationFormatter()
    runner = Runner(formatter)

    for file_ in _specs():
        module = imp.load_source(file_.replace('.py', ''), file_)
        runner.run(module)

    formatter.format_summary()

    if runner.has_failed_specs:
        sys.exit(1)


def _specs():
    if len(sys.argv) == 1:
        collected = []
        for root, dirs, files in os.walk('spec'):
            collected.extend([os.path.join(root, file_) for file_ in files if file_.endswith('_spec.py')])
        collected.sort()
        return collected
    else:
        return sys.argv[1:]


if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-

import sys
import imp

from mamba import formatters
from mamba.runner import Runner


def main():
    formatter = formatters.DocumentationFormatter()
    runner = Runner(formatter)

    for file_ in sys.argv[1:]:
        module = imp.load_source(file_.replace('.py', ''), file_)
        runner.run(module)

    formatter.format_summary()

    if runner.has_failed_specs:
        sys.exit(1)


if __name__ == '__main__':
    main()

--- 
+++ 
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 
 import sys
+import os
 import imp
 
 from mamba import formatters
@@ -11,7 +12,7 @@
     formatter = formatters.DocumentationFormatter()
     runner = Runner(formatter)
 
-    for file_ in sys.argv[1:]:
+    for file_ in _specs():
         module = imp.load_source(file_.replace('.py', ''), file_)
         runner.run(module)
 
@@ -21,5 +22,16 @@
         sys.exit(1)
 
 
+def _specs():
+    if len(sys.argv) == 1:
+        collected = []
+        for root, dirs, files in os.walk('spec'):
+            collected.extend([os.path.join(root, file_) for file_ in files if file_.endswith('_spec.py')])
+        collected.sort()
+        return collected
+    else:
+        return sys.argv[1:]
+
+
 if __name__ == '__main__':
     main()
Load specs from spec/**/*_spec.py if no spec was specified
