diff --git a/README.rst b/README.rst index e2f303fe9..ac95a31e5 100644 --- a/README.rst +++ b/README.rst @@ -116,7 +116,22 @@ In my case I'm using Python 3 with Windows, so I fire up my command shell (cmd.exe) and run this: .. image:: https://user-images.githubusercontent.com/2614930/28401747-f723ff00-6cd0-11e7-9b9a-a6993b753cf6.png +Skipping to a Specific Lesson +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If you have already completed earlier koans or want to work on a specific +lesson, you can start the koans from that lesson by passing the lesson name as +an argument. + +For example:: + + python contemplate_koans.py about_strings + +or: + + python3 contemplate_koans.py about_strings + +This starts the koans from ``about_strings`` instead of the first lesson. Apparently a test failed:: AssertionError: False is not True diff --git a/koans/about_strings.py b/koans/about_strings.py index 25f5f59df..5e11917ce 100644 --- a/koans/about_strings.py +++ b/koans/about_strings.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- + + from runner.koan import * class AboutStrings(Koan): @@ -26,12 +28,15 @@ def test_raw_strings_are_also_strings(self): self.assertEqual(__, isinstance(string, str)) def test_use_single_quotes_to_create_string_with_double_quotes(self): - string = 'He said, "Go Away."' - self.assertEqual(__, string) + single_quoted = 'He said, "Go Away."' + double_quoted = "He said, \"Go Away.\"" + self.assertEqual(__, single_quoted == double_quoted) def test_use_double_quotes_to_create_strings_with_single_quotes(self): - string = "Don't" - self.assertEqual(__, string) + double_quoted = "Don't" + single_quoted = 'Don\'t' + + self.assertEqual(__, single_quoted == double_quoted) def test_use_backslash_for_escaping_quotes_in_strings(self): a = "He said, \"Don't\""