diff options
Diffstat (limited to 'yarns/900-implements.yarn')
-rw-r--r-- | yarns/900-implements.yarn | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index 4086a2f..5468a6c 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -108,17 +108,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. expected_text = get_next_match() expected = json.loads(expected_text) actual = json.loads(vars['body']) - print('expected', json.dumps(expected, indent=4)) - print('actual', json.dumps(actual, indent=4)) + print 'expected' + json.dump(expected, sys.stdout, indent=4, sort_keys=True) + print + print 'actual' + json.dump(actual, sys.stdout, indent=4, sort_keys=True) + print diff = dict_diff(expected, actual) if diff is not None: print(diff) assert 0 - IMPLEMENTS THEN body text is "(.*)" - expected = unescape(get_next_match()) - actual = vars['body'] - assertEqual(expected, actual) + IMPLEMENTS THEN body text contains "(.*)" + pattern = unescape(get_next_match()) + text = vars['body'] + print 'pattern:', repr(pattern) + print 'text:', text + assertTrue(pattern in text) IMPLEMENTS THEN body is the same as the blob (\S+) filename = get_next_match() @@ -142,10 +148,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. IMPLEMENTS THEN result is step (.+) step = json.loads(get_next_match()) - body = json.loads(vars['body']) - actual_step = body['step'] print('expected step', step) + body = json.loads(vars['body']) print('actual body', body) + actual_step = body['step'] print('actual step', actual_step) diff = dict_diff(step, actual_step) print('diff', diff) |