summaryrefslogtreecommitdiff
path: root/yarnlib
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-06-09 12:06:49 +0100
committerLars Wirzenius <liw@liw.fi>2013-06-09 12:06:49 +0100
commitd5b13256d9db7f94420a0b052055f691a3ede56f (patch)
tree5923a6a4df2ad46ff572f0af32363d37a788af34 /yarnlib
parentabd136759d96a9754bb848699889742b2810bb66 (diff)
downloadcmdtest-d5b13256d9db7f94420a0b052055f691a3ede56f.tar.gz
Add test for AND
Diffstat (limited to 'yarnlib')
-rw-r--r--yarnlib/block_parser_tests.py7
1 files changed, 5 insertions, 2 deletions
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 '])