Commits

Rudy Lattae committed d7a15e0

Add support for 'given' as context definition

Comments (0)

Files changed (2)

 # these are the options that are passed to nose
 NOSE_OPTIONS = [
     '-i "([Ss]pec[s]?)(.py)?$"',
-    '-i "^([Dd]escribe)"',
+    '-i "^([Dd]escribe)|([Gg]iven)"',
     '-i "^(it_|should_)"',
     '--with-doctest'
 ]

specs/alternative_grammar_specs.py

+"""Example specs for alternative grammar
+
+"given" is useful in the situation where the specfile is 
+focused on a particular function. In such a case, given may be 
+used to provide a context for a set of specs.
+"""
+
+# e.g. in read_csv_specs.py
+class given_a_valid_csv_file:
+    def it_successfully_parses_and_returns_array_result(self):
+        pass
+        
+class given_an_invalid_csv_file:
+    def it_raises_an_error(self):
+        pass