forked from jrnl-org/jrnl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
format.feature
631 lines (538 loc) · 33 KB
/
format.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
# Copyright © 2012-2022 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Custom formats
Scenario Outline: Short printing via --format flag
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --format short -3"
Then we should get no error
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario Outline: Pretty Printing aka the Default
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --format pretty -3"
Then we should get no error
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario Outline: JSON format
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --format json"
Then we should get no error
And the output should be valid JSON
Given we parse the output as JSON
Then "entries" in the parsed output should have 3 elements
And "tags" in the parsed output should be
@ipsum
@tagone
@tagtwo
@tagthree
And "entries.0.tags" in the parsed output should have 3 elements
And "entries.1.tags" in the parsed output should have 1 elements
And "entries.2.tags" in the parsed output should have 2 elements
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario: Exporting dayone to json should include UUID
Given we use the config "dayone.yaml"
When we run "jrnl --export json"
Then we should get no error
And the output should be valid JSON
Given we parse the output as JSON
Then "entries.0.uuid" in the parsed output should be
4BB1F46946AD439996C9B59DE7C4DDC1
Scenario Outline: Printing a journal that has multiline entries with tags
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl -n 1 @ipsum"
Then we should get no error
And the output should be
2020-08-29 11:11 Entry the first.
| Lorem @ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada
| quis est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus
| pellentesque
| augue et venenatis facilisis. Suspendisse potenti. Sed dignissim sed nisl eu
| consequat. Aenean ante ex, elementum ut interdum et, mattis eget lacus. In
| commodo nulla nec tellus placerat, sed ultricies metus bibendum. Duis eget
| venenatis erat. In at dolor dui. @tagone and maybe also @tagtwo.
|
| Curabitur accumsan nunc ac neque tristique, eleifend faucibus justo
| ullamcorper. Suspendisse at mattis nunc. Nullam eget lacinia urna. Suspendisse
| potenti. Ut urna est, venenatis sed ante in, ultrices congue mi. Maecenas eget
| molestie metus. Mauris porttitor dui ornare gravida porta. Quisque sed lectus
| hendrerit, lacinia ante eget, vulputate ante. Aliquam vitae erat non felis
| feugiat sagittis. Phasellus quis arcu fringilla, mattis ligula id, vestibulum
| urna. Vivamus facilisis leo a mi tincidunt condimentum. Donec eu euismod enim.
| Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu ligula eget
| velit scelerisque fringilla. Phasellus pharetra justo et nulla fringilla, ac
| porta sapien accumsan. Class aptent taciti sociosqu ad litora torquent per
| conubia nostra, per inceptos himenaeos.
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario Outline: Exporting using filters should only export parts of the journal
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl -until 'August 2020' --format json"
Then the output should be valid JSON
Then we should get no error
And the output should be valid JSON
Given we parse the output as JSON
Then "entries" in the parsed output should have 2 elements
And "tags" in the parsed output should be
@ipsum
@tagone
@tagtwo
And "entries.0.tags" in the parsed output should have 3 elements
And "entries.1.tags" in the parsed output should have 1 elements
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario Outline: Increasing Headings on Markdown export
Given we use the config "<config_file>"
And we use the password "test" if prompted
Given we append to the editor if opened
[2021-10-14 13:23] Heading Test
H1-1
=
H1-2
===
H1-3
============================
H2-1
-
H2-2
---
H2-3
----------------------------------
Horizontal Rules (ignore)
---
===
# ATX H1
## ATX H2
### ATX H3
#### ATX H4
##### ATX H5
###### ATX H6
Stuff
More stuff
more stuff again
When we run "jrnl --edit -1"
Then the editor should have been called
When we run "jrnl -1 --export markdown"
Then the output should be
# 2021
## October
### 2021-10-14 13:23 Heading Test
#### H1-1
#### H1-2
#### H1-3
##### H2-1
##### H2-2
##### H2-3
Horizontal Rules (ignore)
---
===
#### ATX H1
##### ATX H2
###### ATX H3
####### ATX H4
######## ATX H5
######### ATX H6
Stuff
More stuff
more stuff again
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
# | basic_dayone.yaml | @todo
@skip
Scenario Outline: Exporting to XML
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --export xml"
Then the output should be a valid XML string
And "entries" in the xml output should have 3 elements
And "tags" in the xml output should contain
@ipsum
@tagone
@tagtwo
@tagthree
And there should be 10 "tag" elements
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario: Exporting to XML single
Given we use the config "tags.yaml"
And we use the password "test" if prompted
When we run "jrnl --export xml"
Then the output should be valid XML
Given we parse the output as XML
Then "entries" in the parsed output should have 2 elements
And "tags" in the parsed output should be
@idea
@journal
@dan
And there should be 7 "tag" elements
Scenario Outline: Exporting tags
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --export tags"
Then the output should be
@tagtwo : 2
@tagone : 2
@tagthree : 1
@ipsum : 1
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario Outline: Export fancy with small linewrap
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --config-override linewrap 35 --format fancy -3"
Then we should get no error
And the output should be 35 columns wide
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
@todo
Scenario Outline: Exporting fancy
# Needs better emoji support
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --export fancy"
Then the output should be
┎──────────────────────────────────────────────────────────────╮2020-08-29 11:11
┃ Entry the first. ╘═══════════════╕
┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
┃ Lorem @ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada │
┃ quis est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus │
┃ pellentesque │
┃ augue et venenatis facilisis. Suspendisse potenti. Sed dignissim sed nisl eu │
┃ consequat. Aenean ante ex, elementum ut interdum et, mattis eget lacus. In │
┃ commodo nulla nec tellus placerat, sed ultricies metus bibendum. Duis eget │
┃ venenatis erat. In at dolor dui. @tagone and maybe also @tagtwo. │
┃ │
┃ Curabitur accumsan nunc ac neque tristique, eleifend faucibus justo │
┃ ullamcorper. Suspendisse at mattis nunc. Nullam eget lacinia urna. │
┃ Suspendisse │
┃ potenti. Ut urna est, venenatis sed ante in, ultrices congue mi. Maecenas │
┃ eget │
┃ molestie metus. Mauris porttitor dui ornare gravida porta. Quisque sed │
┃ lectus │
┃ hendrerit, lacinia ante eget, vulputate ante. Aliquam vitae erat non felis │
┃ feugiat sagittis. Phasellus quis arcu fringilla, mattis ligula id, │
┃ vestibulum │
┃ urna. Vivamus facilisis leo a mi tincidunt condimentum. Donec eu euismod │
┃ enim. │
┃ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu ligula eget │
┃ velit scelerisque fringilla. Phasellus pharetra justo et nulla fringilla, ac │
┃ porta sapien accumsan. Class aptent taciti sociosqu ad litora torquent per │
┃ conubia nostra, per inceptos himenaeos. │
┖──────────────────────────────────────────────────────────────────────────────┘
┎──────────────────────────────────────────────────────────────╮2020-08-31 14:32
┃ A second entry in what I hope to be a long series. ╘═══════════════╕
┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
┃ Sed sit amet metus et sapien feugiat elementum. Aliquam bibendum lobortis │
┃ leo │
┃ vitae tempus. Donec eleifend nec mi non volutpat. Lorem ipsum dolor sit │
┃ amet, │
┃ consectetur adipiscing elit. Praesent ut sodales libero. Maecenas nisl │
┃ lorem, │
┃ vestibulum in tempus sit amet, fermentum ut arcu. Donec vel vestibulum │
┃ lectus, │
┃ eget pretium enim. Maecenas diam nunc, imperdiet vitae pharetra sed, pretium │
┃ id │
┃ lectus. Donec eu metus et turpis tempor tristique ac non ex. In tellus arcu, │
┃ egestas at efficitur et, ultrices vel est. Sed commodo et nibh non │
┃ elementum. │
┃ Mauris tempus vitae neque vel viverra. @tagtwo all by its lonesome. │
┃ │
┃ Nulla mattis elementum magna, viverra pretium dui fermentum et. Cras vel │
┃ vestibulum odio. Quisque sit amet turpis et urna finibus maximus. Interdum │
┃ et │
┃ malesuada fames ac ante ipsum primis in faucibus. Fusce porttitor iaculis │
┃ sem, │
┃ non dictum ipsum varius nec. Nulla eu erat at risus gravida blandit non vel │
┃ ante. Nam egestas ipsum leo, eu ultricies ipsum tincidunt vel. Morbi a │
┃ commodo │
┃ eros. │
┃ │
┃ Nullam dictum, nisl ac varius tempus, ex tortor fermentum nisl, non │
┃ tempus dolor neque a lorem. Suspendisse a faucibus ex, vel ornare tortor. │
┃ Maecenas tincidunt id felis quis semper. Pellentesque enim libero, fermentum │
┃ quis metus id, rhoncus euismod magna. Nulla finibus velit eu purus bibendum │
┃ interdum. Integer id justo dui. Integer eu tellus in turpis bibendum │
┃ blandit. │
┃ Quisque auctor lacinia consectetur. │
┖──────────────────────────────────────────────────────────────────────────────┘
┎──────────────────────────────────────────────────────────────╮2020-09-24 09:14
┃ The third entry finally after weeks without writing. ╘═══════════════╕
┠╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
┃ I'm so excited about emojis. 💯 🎶 💩 │
┃ │
┃ Donec semper pellentesque iaculis. Nullam cursus et justo sit amet │
┃ venenatis. │
┃ Vivamus tempus ex dictum metus vehicula gravida. Aliquam sed sem dolor. │
┃ Nulla │
┃ eget ultrices purus. Quisque at nunc at quam pharetra consectetur vitae quis │
┃ dolor. Fusce ultricies purus eu est feugiat, quis scelerisque nibh │
┃ malesuada. │
┃ Quisque egestas semper nibh in hendrerit. Nam finibus ex in mi mattis │
┃ vulputate. Sed mauris urna, consectetur in justo eu, volutpat accumsan │
┃ justo. │
┃ Phasellus aliquam lacus placerat convallis vestibulum. Curabitur maximus at │
┃ ante eget fringilla. @tagthree and also @tagone │
┖──────────────────────────────────────────────────────────────────────────────┘
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
@skip_win
Scenario Outline: Export to yaml
Given we use the config "<config_file>"
And we use the password "test" if prompted
And we create a cache directory
When we run "jrnl --format yaml --file {cache_dir}"
Then the cache directory should contain the files
2020-08-29_entry-the-first.md
2020-08-31_a-second-entry-in-what-i-hope-to-be-a-long-series.md
2020-09-24_the-third-entry-finally-after-weeks-without-writing.md
And the content of file "2020-08-29_entry-the-first.md" in the cache should be
---
title: Entry the first.
date: 2020-08-29 11:11
starred: False
tags: tagone, ipsum, tagtwo
body: |
Lorem @ipsum dolor sit amet, consectetur adipiscing elit. Praesent malesuada
quis est ac dignissim. Aliquam dignissim rutrum pretium. Phasellus pellentesque
augue et venenatis facilisis. Suspendisse potenti. Sed dignissim sed nisl eu
consequat. Aenean ante ex, elementum ut interdum et, mattis eget lacus. In
commodo nulla nec tellus placerat, sed ultricies metus bibendum. Duis eget
venenatis erat. In at dolor dui. @tagone and maybe also @tagtwo.
Curabitur accumsan nunc ac neque tristique, eleifend faucibus justo
ullamcorper. Suspendisse at mattis nunc. Nullam eget lacinia urna. Suspendisse
potenti. Ut urna est, venenatis sed ante in, ultrices congue mi. Maecenas eget
molestie metus. Mauris porttitor dui ornare gravida porta. Quisque sed lectus
hendrerit, lacinia ante eget, vulputate ante. Aliquam vitae erat non felis
feugiat sagittis. Phasellus quis arcu fringilla, mattis ligula id, vestibulum
urna. Vivamus facilisis leo a mi tincidunt condimentum. Donec eu euismod enim.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu ligula eget
velit scelerisque fringilla. Phasellus pharetra justo et nulla fringilla, ac
porta sapien accumsan. Class aptent taciti sociosqu ad litora torquent per
conubia nostra, per inceptos himenaeos.
...
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
# | basic_dayone.yaml |
Scenario Outline: Exporting YAML to nonexistent directory leads to user-friendly error with no traceback
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --export yaml --file nonexistent_dir"
Then the output should contain "YAML export must be to a directory"
And the output should not contain "Traceback"
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
@skip_win # @todo YAML exporter does not correctly export emoji on Windows
Scenario Outline: Add a blank line to YAML export if there isn't one already
# https://github.com/jrnl-org/jrnl/issues/768
# https://github.com/jrnl-org/jrnl/issues/881
Given we use the config "<config_file>"
And we use the password "test" if prompted
And we create a cache directory
When we run "jrnl --export yaml -o {cache_dir}"
Then the cache should contain the files
2020-08-29_entry-the-first.md
2020-08-31_a-second-entry-in-what-i-hope-to-be-a-long-series.md
2020-09-24_the-third-entry-finally-after-weeks-without-writing.md
And the content of file "2020-09-24_the-third-entry-finally-after-weeks-without-writing.md" in the cache should be
---
title: The third entry finally after weeks without writing.
date: 2020-09-24 09:14
starred: False
tags: tagone, tagthree
body: |
I'm so excited about emojis. 💯 🎶 💩
Donec semper pellentesque iaculis. Nullam cursus et justo sit amet venenatis.
Vivamus tempus ex dictum metus vehicula gravida. Aliquam sed sem dolor. Nulla
eget ultrices purus. Quisque at nunc at quam pharetra consectetur vitae quis
dolor. Fusce ultricies purus eu est feugiat, quis scelerisque nibh malesuada.
Quisque egestas semper nibh in hendrerit. Nam finibus ex in mi mattis
vulputate. Sed mauris urna, consectetur in justo eu, volutpat accumsan justo.
Phasellus aliquam lacus placerat convallis vestibulum. Curabitur maximus at
ante eget fringilla. @tagthree and also @tagone
...
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
# | basic_dayone.yaml | @todo
Scenario: Empty DayOne entry bodies should not error
# https://github.com/jrnl-org/jrnl/issues/780
Given we use the config "bug780.yaml"
When we run "jrnl --short"
Then we should get no error
Scenario Outline: --short displays the short version of entries (only the title)
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl -on 2020-08-31 --short"
Then the output should be "2020-08-31 14:32 A second entry in what I hope to be a long series."
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario Outline: -s displays the short version of entries (only the title)
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl -on 2020-08-31 -s"
Then the output should be "2020-08-31 14:32 A second entry in what I hope to be a long series."
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario: Markdown Support from config file
Given we use the config "format_md.yaml"
When we run "jrnl -n 1"
Then the output should be
# 2013
## June
### 2013-06-10 15:40 Life is good.
But I'm better.
Scenario: Text Formatter from config file
Given we use the config "format_text.yaml"
When we run "jrnl -n 1"
Then the output should be
[2013-06-10 15:40] Life is good.
But I'm better.
Scenario Outline: Exporting entries with Cyrillic characters to directory should not fail
Given we use the config "<config_file>"
And we use the password "test" if prompted
And we create a cache directory
When we run "jrnl 2020-11-21: Первая"
When we run "jrnl --format md --file {cache_dir} -on 2020-11-21"
Then the cache should contain the files
2020-11-21_первая.md
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario Outline: Export date counts
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl 2020-08-31 01:01: Hi."
And we run "jrnl --format dates"
Then the output should be
2020-08-29, 1
2020-08-31, 2
2020-09-24, 1
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario Outline: display_format short and pretty do not crash if specified as config values
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --config-override display_format short -1"
Then we should get no error
When we run "jrnl --config-override display_format pretty -1"
Then we should get no error
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |
Scenario: Export entries in markdown format with a title longer than max file name length.
Given we use the config "basic_onefile.yaml"
And we create a cache directory
When we run "jrnl 2022-07-31 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Laoreet id donec ultrices tincidunt arcu Dolor sit amet consectetur adipiscing elit duis tristique sollicitudin Ut pharetra sit amet aliquam id diam maecenas Habitasse platea dictumst quisque sagittis Aliquam purus sit amet luctus venenatis lectus magna Aenean sed adipiscing diam donec adipiscing tristique risus nec feugiat Diam vel quam elementum pulvinar etiam non Odio ut enim blandit volutpat maecenas volutpat Lacus vestibulum sed arcu non odio euismod lacinia at quis. Pretium nibh ipsum consequat nisl."
When we run "jrnl 2022-07-31 Magna fermentum iaculis eu non diam phasellus Non pulvinar neque laoreet suspendisse interdum consectetur libero id Scelerisque felis imperdiet proin fermentum leo Eu ultrices vitae auctor eu augue ut lectus Bibendum arcu vitae elementum curabitur vitae nunc sed Tincidunt tortor aliquam nulla facilisi cras fermentum Malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel Non sodales neque sodales ut Enim nulla aliquet porttitor lacus luctus accumsan Volutpat blandit aliquam etiam erat velit scelerisque in dictum non Egestas fringilla phasellus faucibus scelerisque At risus viverra adipiscing at in tellus integer feugiat scelerisque Eget velit aliquet sagittis id consectetur purus ut Imperdiet nulla malesuada pellentesque elit eget gravida cum sociis Lacus vestibulum sed arcu non odio euismod lacinia at Elit pellentesque habitant morbi tristique Vestibulum lorem sed risus ultricies Integer eget aliquet nibh praesent tristique magna sit amet purus Quisque id diam vel quam elementum pulvinar etiam non quam Nisi scelerisque eu ultrices vitae auctor eu augue. Malesuada fames ac turpis egestas integer eget aliquet."
When we run "jrnl --format markdown --file {cache_dir}"
Then the cache directory should contain 5 files
And we should get no error
Scenario: Export entries in text format with a title longer than max file name length.
Given we use the config "basic_onefile.yaml"
And we create a cache directory
When we run "jrnl 2022-07-31 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Laoreet id donec ultrices tincidunt arcu Dolor sit amet consectetur adipiscing elit duis tristique sollicitudin Ut pharetra sit amet aliquam id diam maecenas Habitasse platea dictumst quisque sagittis Aliquam purus sit amet luctus venenatis lectus magna Aenean sed adipiscing diam donec adipiscing tristique risus nec feugiat Diam vel quam elementum pulvinar etiam non Odio ut enim blandit volutpat maecenas volutpat Lacus vestibulum sed arcu non odio euismod lacinia at quis. Pretium nibh ipsum consequat nisl."
When we run "jrnl 2022-07-31 Magna fermentum iaculis eu non diam phasellus Non pulvinar neque laoreet suspendisse interdum consectetur libero id Scelerisque felis imperdiet proin fermentum leo Eu ultrices vitae auctor eu augue ut lectus Bibendum arcu vitae elementum curabitur vitae nunc sed Tincidunt tortor aliquam nulla facilisi cras fermentum Malesuada nunc vel risus commodo viverra maecenas accumsan lacus vel Non sodales neque sodales ut Enim nulla aliquet porttitor lacus luctus accumsan Volutpat blandit aliquam etiam erat velit scelerisque in dictum non Egestas fringilla phasellus faucibus scelerisque At risus viverra adipiscing at in tellus integer feugiat scelerisque Eget velit aliquet sagittis id consectetur purus ut Imperdiet nulla malesuada pellentesque elit eget gravida cum sociis Lacus vestibulum sed arcu non odio euismod lacinia at Elit pellentesque habitant morbi tristique Vestibulum lorem sed risus ultricies Integer eget aliquet nibh praesent tristique magna sit amet purus Quisque id diam vel quam elementum pulvinar etiam non quam Nisi scelerisque eu ultrices vitae auctor eu augue. Malesuada fames ac turpis egestas integer eget aliquet."
When we run "jrnl --format text --file {cache_dir}"
Then the cache directory should contain 5 files
And we should get no error
Scenario: Export journal list to multiple formats.
Given we use the config "basic_onefile.yaml"
When we run "jrnl --list"
Then the output should match
Journals defined in config \(.+basic_onefile\.yaml\)
\* default -> features/journals/basic_onefile\.journal
When we run "jrnl --list --format json"
Then the output should match
{"config_path": ".+basic_onefile\.yaml", "journals": {"default": "features/journals/basic_onefile\.journal"}}
When we run "jrnl --list --format yaml"
Then the output should match
config_path: .+basic_onefile\.yaml
journals:
default: features/journals/basic_onefile\.journal
Scenario: Export journal list to formats with no default journal
Given we use the config "no_default_journal.yaml"
When we run "jrnl --list"
Then the output should match
Journals defined in config \(.+no_default_journal\.yaml\)
\* simple -> features/journals/simple\.journal
\* work -> features/journals/work\.journal
When we run "jrnl --list --format json"
Then the output should match
{"config_path": ".+no_default_journal\.yaml", "journals": {"simple": "features/journals/simple\.journal", "work": "features/journals/work\.journal"}}
When we run "jrnl --list --format yaml"
Then the output should match
config_path: .+no_default_journal\.yaml
journals:
simple: features/journals/simple\.journal
work: features/journals/work\.journal