diff --git a/README.md b/README.md index ae728056c..87a9e2245 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ To get this up and running as a command line utility, run `python setup.py devel ## Creating a new check 0. Pick a name for your check, e.g., `abc_checkname`. -1. Create a copy of `checks/example_check.py`, renaming it `abc_checkname.py` and placing it in `checks/`. +1. Create a copy of `checks/inprogress/example_check.py`, renaming it `abc_checkname.py` and placing it in `checks/inprogress/`. 2. Edit your check. 3. Create a new test file `test_abc_checkname.py` and place it in `tests`. 4. Run the test suite using `nosetests`. diff --git a/proselint/checks/example_check.py b/proselint/checks/inprogress/example_check.py similarity index 99% rename from proselint/checks/example_check.py rename to proselint/checks/inprogress/example_check.py index 74207180e..6ec5fcd91 100644 --- a/proselint/checks/example_check.py +++ b/proselint/checks/inprogress/example_check.py @@ -16,7 +16,6 @@ """ from proselint.reverse import reverse - def check(text): reversed_text = reverse(text) diff --git a/test.md b/test.md deleted file mode 100644 index 324b5e565..000000000 --- a/test.md +++ /dev/null @@ -1,3 +0,0 @@ -Besides being long, this sentence is very -unique, having only appeared here. -Obviously, duh. diff --git a/tests/samples/test.md b/tests/samples/test.md new file mode 100644 index 000000000..2fe6575e7 --- /dev/null +++ b/tests/samples/test.md @@ -0,0 +1 @@ +The quick brown fox jumps over the lazy dog. diff --git a/tests/test_samples.py b/tests/test_samples.py new file mode 100644 index 000000000..bc4e779c7 --- /dev/null +++ b/tests/test_samples.py @@ -0,0 +1,20 @@ +import os +import subprocess + + +class TestSamples(object): + + def test_samples(self): + examples_dir = os.path.join(os.getcwd(), "tests", "samples") + examples = os.listdir(examples_dir) + + for example in examples: + example_path = os.path.join(examples_dir, example) + out = subprocess.check_output( + "proselint " + example_path, + shell=True) + + num_errors = out.count("\n") + + assert num_errors == 0, \ + "{} produced {} errors.".format(example, num_errors)