Rudy Lattae  committed d7a15e0

Add support for 'given' as context definition

  • Participants
  • Parent commits f62dca6
  • Branches default

Comments (0)

Files changed (2)

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

File specs/

+"""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
+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