| 1 | # oil-builtin-describe |
| 2 | # |
| 3 | # Some thoughts before writing code. Hm can we do this entirely in user code, not as a builtin? |
| 4 | # |
| 5 | |
| 6 | #### Describe Prototype |
| 7 | |
| 8 | hay define argparse |
| 9 | |
| 10 | # Oops, we're running into this problem ... |
| 11 | |
| 12 | hay define argparse/flag |
| 13 | |
| 14 | proc p { |
| 15 | echo STDOUT |
| 16 | echo STDERR >& 2 |
| 17 | return 42 |
| 18 | } |
| 19 | |
| 20 | describe p { |
| 21 | # each case changes to a clean directory? |
| 22 | # |
| 23 | # and each one is numbered? |
| 24 | |
| 25 | it 'prints to stdout and stderr' { |
| 26 | try { |
| 27 | p > out 2>& err |
| 28 | } |
| 29 | assert (_status === 42) |
| 30 | |
| 31 | cat out |
| 32 | cat err |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | ## STDOUT: |
| 37 | TODO |
| 38 | ## END |