diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-08-19 18:53:54 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-08-19 18:53:54 +0100 |
commit | a3bfd4de13e415c3c8267762311340579967cbbb (patch) | |
tree | 834cc989d7a225bd34f0b1060921d4d97490924d /yarn | |
parent | 3ca820dce1960509a29688f170538cb4ca5ac577 (diff) | |
download | cmdtest-a3bfd4de13e415c3c8267762311340579967cbbb.tar.gz |
Complain if a scenario has no THENs
Diffstat (limited to 'yarn')
-rwxr-xr-x | yarn | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -108,6 +108,7 @@ class YarnRunner(cliapp.Application): 'step %Index(step,steps): %String(step_name)') scenarios, implementations = self.parse_scenarios(args) + self.check_for_thens(scenarios) self.connect_implementations(scenarios, implementations) shell_prelude = self.load_shell_libraries() @@ -157,6 +158,20 @@ class YarnRunner(cliapp.Application): return block_parser.scenarios, block_parser.implementations + def check_for_thens(self, scenarios): + no_thens = [] + for scenario in scenarios: + for step in scenario.steps: + if step.what == 'THEN': + break + else: + no_thens.append(scenario) + + if no_thens: + raise cliapp.AppException( + 'Some scenarios have no THENs:\n%s' % + ''.join(' "%s"\n' % s.name for s in scenarios)) + def connect_implementations(self, scenarios, implementations): for scenario in scenarios: for step in scenario.steps: |