Commits

Rudy Lattae  committed a811588

Remove support for examples and features - YAGNI

  • Participants
  • Parent commits 93340da

Comments (0)

Files changed (9)

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

File example/basic_specs.py

-"""An example of a specfile that checkit auto-discovers
-
-Notice that:
-
-* there is no import of unittest stuff
-* there is no need to use the "test" prefix for your specs to be run
-* individual specs are marked with "it" or "should"
-"""
-
-class DescribeWinter:
-    """The prefix "Describe" makes it possible for checkit to 
-    auto-discover this spec suite"""
-
-    def it_is_cold(self):
-        pass
-
-    def it_is_not_hot(self):
-        pass
-
-    def it_usually_snows(self):
-        pass
-
-
-class BasicSpec:
-    """This suite is recognised because the class name ends with 'Spec'"""
-    def it_should_also_run_alright(self):
-        pass 
-
-
-class SummerSeasonSpecs:
-    """Checkit will auto-discover this suite because of the "Specs" suffix."""
-    
-    def should_usually_be_warm(self):
-        """The keyword "should" marks this as a spec."""
-        pass
-
-    def test_okay_this_is_awkward(self):
-        # This awkward "test" will be run as well, 
-        # so we do not lose legacy unittest support
-        pass
-        
-    def _should_sometimes_be_scorching_hot(self):
-        """Since this is provate method, it will not be run."""
-        assert False == True, 'This spec must not be run'
-        
-    def _it_could_be_humid(self):
-        """Since this is private method, it will not be run."""
-        assert False == True, 'This spec must not be run'
-

File example/doctest_examples.py

-"""Doctest examples. Checkit auto-discovers and runs all doctests.
-
-The examples below are module-level doctests.
-
-Add a couple of numbers together:
-    >>> 4 + 5
-    9
-
-Compare two values:
-    >>> x = 6
-    >>> y = 7
-    >>> x == y
-    False
-"""
-
-def get_name():
-    """An example of a function level doctest.
-    
-    >>> get_name() == 'You'
-    True
-    """
-    return 'You'
-
-    
-class Thing(object):
-    """Example of a class level doctest.
-    
-    This is how you create a fresh thing:
-    >>> mything = Thing('Sofa')
-    >>> mything.name == 'Sofa'
-    True
-    >>> mything.useful
-    True
-    """
-    
-    def __init__(self, name):
-        self.name = name
-        self.useful = True
-    
-    def crush(self):
-        """Example of a method level doctest.
-        
-        What happens when you crush a thing?
-        By default, it becomes useless:
-        >>> thing = Thing('Glass of water')
-        >>> thing.crush()
-        True
-        >>> thing.useful
-        False
-        """
-        self.useful = False
-        return True     # it was successfully crushed
-    

File example/light_weight_features.py

-"""An example of python based feature files (poor developer's version)"""
-
-class AwesomeProductFeature:
-    def when_there_is_a_valid_spec(self):
-        pass

File example/unittest_based_tests.py

-"""This module illustrates that checkit is capable of discovering and 
-running regular unittest tests"""
-
-import unittest
-
-
-class SimpleTestCase(unittest.TestCase):
-    """A regular unittest class that inherits from 'unittest.TestCase'"""
-    
-    def test_it_should_run_and_pass(self):
-        def make_lower_case(what):
-            return what.lower()
-        self.assertEqual("foo", make_lower_case("Foo"))
-
-    def this_one_is_not_run(self):
-        self.fail()
 import os
 from setuptools import setup
 
-version = '0.2.3b'
+version = '0.3.1b'
 long_description = '\n\n'.join([
     open('README.rst').read(),
     open('CHANGES.txt').read(),

File specs/basic_specs.py

+"""An example of a specfile that checkit auto-discovers
+
+Notice that:
+
+* there is no import of unittest stuff
+* there is no need to use the "test" prefix for your specs to be run
+* individual specs are marked with "it" or "should"
+"""
+
+class DescribeWinter:
+    """The prefix "Describe" makes it possible for checkit to 
+    auto-discover this spec suite"""
+
+    def it_is_cold(self):
+        pass
+
+    def it_is_not_hot(self):
+        pass
+
+    def it_usually_snows(self):
+        pass
+
+
+class BasicSpec:
+    """This suite is recognised because the class name ends with 'Spec'"""
+    def it_should_also_run_alright(self):
+        pass 
+
+
+class SummerSeasonSpecs:
+    """Checkit will auto-discover this suite because of the "Specs" suffix."""
+    
+    def should_usually_be_warm(self):
+        """The keyword "should" marks this as a spec."""
+        pass
+
+    def test_okay_this_is_awkward(self):
+        # This awkward "test" will be run as well, 
+        # so we do not lose legacy unittest support
+        pass
+        
+    def _should_sometimes_be_scorching_hot(self):
+        """Since this is provate method, it will not be run."""
+        assert False == True, 'This spec must not be run'
+        
+    def _it_could_be_humid(self):
+        """Since this is private method, it will not be run."""
+        assert False == True, 'This spec must not be run'
+

File specs/doctest_specs.py

+"""Doctest examples. Checkit auto-discovers and runs all doctests.
+
+The examples below are module-level doctests.
+
+Add a couple of numbers together:
+    >>> 4 + 5
+    9
+
+Compare two values:
+    >>> x = 6
+    >>> y = 7
+    >>> x == y
+    False
+"""
+
+def get_name():
+    """An example of a function level doctest.
+    
+    >>> get_name() == 'You'
+    True
+    """
+    return 'You'
+
+    
+class Thing(object):
+    """Example of a class level doctest.
+    
+    This is how you create a fresh thing:
+    >>> mything = Thing('Sofa')
+    >>> mything.name == 'Sofa'
+    True
+    >>> mything.useful
+    True
+    """
+    
+    def __init__(self, name):
+        self.name = name
+        self.useful = True
+    
+    def crush(self):
+        """Example of a method level doctest.
+        
+        What happens when you crush a thing?
+        By default, it becomes useless:
+        >>> thing = Thing('Glass of water')
+        >>> thing.crush()
+        True
+        >>> thing.useful
+        False
+        """
+        self.useful = False
+        return True     # it was successfully crushed
+    

File specs/unittest_based_tests.py

+"""This module illustrates that checkit is capable of discovering and 
+running regular unittest tests"""
+
+import unittest
+
+
+class SimpleTestCase(unittest.TestCase):
+    """A regular unittest class that inherits from 'unittest.TestCase'"""
+    
+    def test_it_should_run_and_pass(self):
+        def make_lower_case(what):
+            return what.lower()
+        self.assertEqual("foo", make_lower_case("Foo"))
+
+    def this_one_is_not_run(self):
+        self.fail()