mplewis / csvtomd

📝📊 Convert your CSV files into Markdown tables.
MIT License
655 stars 90 forks source link

Update tests (partly). #7

Closed mkcor closed 7 years ago

mkcor commented 8 years ago

Hi @mplewis !

I'm interested in contributing to this project so I can use input files with other delimiters (; or tabs). I would add an optional argument such as -d, --delimiter, where , is the default.

To do things well, I started by setting up the testing environment. I'm not sure where you're at wrt the testing structure. It wasn't smooth but I was able to get somewhere.

First, I had to upgrade sure not to run into https://github.com/gabrielfalcao/sure/issues/80 (hence commit b08e016).

Then, running test_all_csv_files(), I would get an AssertionError from the EOLs. Reading a plain \n as in this output file leads to a \\n because the \ is escaped... I made the newlines manually (deb5bcc) and then the test would pass. Note that I didn't fix the second input-output pair (jagged) so I checked my piece of improvement by adding a break statement at the end of the block.

Thanks for your consideration.

mplewis commented 8 years ago

Hey @mkcor, thanks for taking a look!

I updated my tests a bit to try and make this project testable. Some of the changes I made look like the ones you did. Want to check out what is available on master?

mplewis commented 7 years ago

Hi @mkcor. Thanks for your help – sorry it took me so long to get back to you.

csvtomd has proper delimiter support now, including automated tests. Check it out! 🍾

mkcor commented 7 years ago

I will! Thanks, @mplewis .