From 9489339ce4c9710067207e5e15c6591ed0bf4782 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 9 Jun 2013 12:10:46 +0100 Subject: Add test for empty shell text for IMPLEMENTS --- yarnlib/block_parser_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'yarnlib') diff --git a/yarnlib/block_parser_tests.py b/yarnlib/block_parser_tests.py index 7051e17..975444f 100644 --- a/yarnlib/block_parser_tests.py +++ b/yarnlib/block_parser_tests.py @@ -92,6 +92,14 @@ class BlockParserTests(unittest.TestCase): self.assertEqual(impls[0].regexp, 'foo') self.assertEqual(impls[0].shell, 'true') + def test_parses_implements_with_empty_shell_text(self): + self.parser.parse_blocks(['IMPLEMENTS GIVEN foo']) + impls = self.parser.implementations + self.assertEqual(len(impls), 1) + self.assertEqual(impls[0].what, 'GIVEN') + self.assertEqual(impls[0].regexp, 'foo') + self.assertEqual(impls[0].shell, '') + def test_parses_two_implements_in_a_code_block(self): self.parser.parse_blocks( ['IMPLEMENTS GIVEN foo\ntrue\nIMPLEMENTS WHEN bar\ncat /dev/null']) -- cgit v1.2.1