From d5b13256d9db7f94420a0b052055f691a3ede56f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 9 Jun 2013 12:06:49 +0100 Subject: Add test for AND --- yarnlib/block_parser_tests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'yarnlib') diff --git a/yarnlib/block_parser_tests.py b/yarnlib/block_parser_tests.py index 0b0c661..b28e258 100644 --- a/yarnlib/block_parser_tests.py +++ b/yarnlib/block_parser_tests.py @@ -32,14 +32,15 @@ class BlockParserTests(unittest.TestCase): def test_parses_simple_elements(self): self.parser.parse_blocks( - ['STORY foo', 'GIVEN bar', 'WHEN foobar\nTHEN yoyo\nFINALLY yay']) + ['STORY foo', 'GIVEN bar', + 'WHEN foobar\nTHEN yoyo\nFINALLY yay\nAND yeehaa']) self.assertEqual(len(self.parser.stories), 1) self.assertEqual(len(self.parser.implementations), 0) story = self.parser.stories[0] self.assertEqual(story.name, 'foo') - self.assertEqual(len(story.steps), 4) + self.assertEqual(len(story.steps), 5) self.assertEqual(story.steps[0].what, 'GIVEN') self.assertEqual(story.steps[0].text, 'bar') self.assertEqual(story.steps[1].what, 'WHEN') @@ -48,6 +49,8 @@ class BlockParserTests(unittest.TestCase): self.assertEqual(story.steps[2].text, 'yoyo') self.assertEqual(story.steps[3].what, 'FINALLY') self.assertEqual(story.steps[3].text, 'yay') + self.assertEqual(story.steps[4].what, 'FINALLY') + self.assertEqual(story.steps[4].text, 'yeehaa') def test_normalises_whitespace(self): self.parser.parse_blocks(['STORY foo bar ']) -- cgit v1.2.1