From edcfa7e9a5926955f516eb432eeb48b09052e5a7 Mon Sep 17 00:00:00 2001 From: Colm O'Connor Date: Mon, 1 Jan 2024 22:06:34 +0000 Subject: [PATCH] REFACTOR : Remove old bug story. --- hitch/rewrite-story-with-bug.todo | 89 ------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 hitch/rewrite-story-with-bug.todo diff --git a/hitch/rewrite-story-with-bug.todo b/hitch/rewrite-story-with-bug.todo deleted file mode 100644 index f4eae6d..0000000 --- a/hitch/rewrite-story-with-bug.todo +++ /dev/null @@ -1,89 +0,0 @@ -Rewrite story: - description: | - Hitch stories can be rewritten in the event that you - are dealing with generated blocks of text. - given: - example.story: | - Do things: - steps: - - Do thing: x - - Do thing: y - - Do thing: z - - Do other thing: - variable 1: a - variable 2: b - - variations: - Do more things: - steps: - - Do thing: c - engine.py: | - from hitchstory import BaseEngine - - class Engine(BaseEngine): - def __init__(self, rewrite=True): - self._rewrite = rewrite - - def do_thing(self, variable): - if self._rewrite: - self.current_step.update( - variable="xxx:\nyyy" - ) - - def do_other_thing(self, variable_1=None, variable_2=None): - if self._rewrite: - self.current_step.update( - variable_2="complicated:\nmultiline\nstring" - ) - - def on_success(self): - self.new_story.save() - setup: | - from hitchstory import StoryCollection - from pathquery import pathq - from engine import Engine - variations: - No changes: - steps: - - Run: - code: | - StoryCollection(pathq(".").ext("story"), Engine(rewrite=False)).ordered_by_name().play() - - Example story unchanged - - Rewritten: - steps: - - Run: - code: | - StoryCollection(pathq(".").ext("story"), Engine(rewrite=True)).ordered_by_name().play() - will output: |- - RUNNING Do things in /path/to/example.story ... SUCCESS in 0.1 seconds. - RUNNING Do things/Do more things in /path/to/example.story ... SUCCESS in 0.1 seconds. - - - File contents will be: - filename: example.story - contents: |- - Do things: - steps: - - Do thing: |- - xxx: - yyy - - Do thing: |- - xxx: - yyy - - Do thing: |- - xxx: - yyy - - Do other thing: - variable 1: a - variable 2: |- - complicated: - multiline - string - - - variations: - Do more things: - steps: - - Do thing: |- - xxx: - yyy