From: Hal Fulton Date: 2004-08-17T13:08:48+09:00 Subject: Idea for testing ruvi I'd really like to have a vim-like editor scriptable in Ruby, so I hope to contribute test cases at the very least. Here's an idea I have. Suppose we have a "canonical" file, a text file about 2K or so in length, to use as a starting point. Then vim can happily read stdin (as can ruvi I guess). Hmm. Actually I just tried ruvi with stdin and had a problem. But I'm guessing that's a quick fix. So anyway, the idea is basically this. cp testfile test1 cp testfile test2 vim test1 /dev/null # edit with vim according to 'cmds' ruvi test2 /dev/null # edit w/ ruvi according to 'cmds' Then if test1 and test2 are the same, the test passes. This way, a test simply becomes a block of text, something easy to communicate back and forth. Note that this method doesn't work for issues such as syntax highlighting. Note also that it might be good to represent this text as a here-doc or Ruby string, so that characters such as \033 can easily be embedded. Thoughts? Hal