From abd136759d96a9754bb848699889742b2810bb66 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 9 Jun 2013 12:06:01 +0100 Subject: Add test for FINALLY --- yarnlib/block_parser_tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'yarnlib') diff --git a/yarnlib/block_parser_tests.py b/yarnlib/block_parser_tests.py index 77a96e1..0b0c661 100644 --- a/yarnlib/block_parser_tests.py +++ b/yarnlib/block_parser_tests.py @@ -32,20 +32,22 @@ class BlockParserTests(unittest.TestCase): def test_parses_simple_elements(self): self.parser.parse_blocks( - ['STORY foo', 'GIVEN bar', 'WHEN foobar\nTHEN yoyo']) + ['STORY foo', 'GIVEN bar', 'WHEN foobar\nTHEN yoyo\nFINALLY yay']) 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), 3) + self.assertEqual(len(story.steps), 4) self.assertEqual(story.steps[0].what, 'GIVEN') self.assertEqual(story.steps[0].text, 'bar') self.assertEqual(story.steps[1].what, 'WHEN') self.assertEqual(story.steps[1].text, 'foobar') self.assertEqual(story.steps[2].what, 'THEN') self.assertEqual(story.steps[2].text, 'yoyo') + self.assertEqual(story.steps[3].what, 'FINALLY') + self.assertEqual(story.steps[3].text, 'yay') def test_normalises_whitespace(self): self.parser.parse_blocks(['STORY foo bar ']) -- cgit v1.2.1