jt.yaml
1 - given: "an installed jt" 2 impl: 3 python: 4 function: install_jt 5 6 - given: "an executable script {filename}" 7 types: 8 filename: file 9 impl: 10 python: 11 function: create_script 12 13 - when: I invoke jt init (?P<dirname>\S+) (?P<journalname>\S+) "(?P<title>.*)" 14 types: 15 dirname: word 16 journalname: word 17 title: text 18 regex: true 19 impl: 20 python: 21 function: run_jt_init 22 23 - when: I invoke jt list-journals 24 impl: 25 python: 26 function: run_jt_list_journals 27 28 - when: I invoke jt is-journal {dirname} 29 impl: 30 python: 31 function: run_jt_is_journal 32 33 - when: I invoke jt new "{title:text}" --editor=none --dirname={dirname} 34 impl: 35 python: 36 function: run_jt_new 37 38 - when: "I invoke jt edit --editor={editor} --dirname={dirname}" 39 regex: false 40 impl: 41 python: 42 function: run_jt_edit 43 44 - when: I invoke jt finish --dirname={dirname} 45 impl: 46 python: 47 function: run_jt_finish 48 49 - when: I edit draft {draftno} in {dirname} to also contain "{text}" 50 impl: 51 python: 52 function: edit_draft 53 54 - then: output contains "(?P<pattern>.*)" 55 types: 56 pattern: text 57 regex: true 58 impl: 59 python: 60 function: output_contains 61 62 - then: there are no drafts in {dirname} 63 impl: 64 python: 65 function: journal_has_no_drafts 66 67 - then: there is one draft in {dirname} 68 impl: 69 python: 70 function: journal_has_one_draft 71 72 - then: there are two drafts in {dirname} 73 impl: 74 python: 75 function: journal_has_two_drafts 76 77 - then: draft {draftno} in {dirname} contains "{pattern:text}" 78 impl: 79 python: 80 function: draft_contains_string 81 82 - then: draft {draftno} in {dirname} links to "{topic}" 83 impl: 84 python: 85 function: draft_links_to_topic 86 87 - then: there are no journal entries in {dirname} 88 impl: 89 python: 90 function: journal_has_no_entries 91 92 - then: there is one journal entry in {dirname}, at {variable} 93 impl: 94 python: 95 function: journal_has_one_entry 96 97 - then: there are two journal entries in {dirname}, at {variable1} and {variable2} 98 impl: 99 python: 100 function: journal_has_two_entries 101 102 - then: journal entry <{variable}> contains "{pattern:text}" 103 impl: 104 python: 105 function: file_contains 106 107 - then: file name <{varname}> ends with {suffix} 108 impl: 109 python: 110 function: file_name_has_suffix 111 112 - then: there are no uncommitted changes in {dirname} 113 impl: 114 python: 115 function: git_is_clean