summaryrefslogtreecommitdiff
path: root/yarnlib
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-06-09 12:06:01 +0100
committerLars Wirzenius <liw@liw.fi>2013-06-09 12:06:01 +0100
commitabd136759d96a9754bb848699889742b2810bb66 (patch)
treec0681efdb6bc146ca0f3662b3bd08c2af69fb0b2 /yarnlib
parentf11c5d87df20aa1b6b5c940844fa4e8cfab42b9e (diff)
downloadcmdtest-abd136759d96a9754bb848699889742b2810bb66.tar.gz
Add test for FINALLY
Diffstat (limited to 'yarnlib')
-rw-r--r--yarnlib/block_parser_tests.py6
1 files changed, 4 insertions, 2 deletions
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 '])