kputnam / stupidedi

Ruby API for parsing and generating ASC X12 EDI transactions
BSD 3-Clause "New" or "Revised" License
265 stars 137 forks source link

Add fixtures (example files) for each transaction set #181

Open kputnam opened 5 years ago

kputnam commented 5 years ago

These transaction sets don't yet have any fixtures, so there aren't any automated tests to ensure their definitions can parse actual files. Even though these might be correct and working fine now, adding fixtures will help prevent any inadvertent regressions when changes are made to other parts of the library.

It is fairly straightforward to add fixtures, just look in spec/fixtures for examples. Then you can run rspec -Ilib -Ispec -rspec_helper --tag fixtures spec to test them (or you can run rake spec to run all specs).

If you have files but want to remove any sensitive information, you can use bin/edi-obfuscate to replace all strings, dates, times, and numbers with placeholder values, before adding to the repository.

kputnam commented 5 years ago

Note some of the 005010 implementations (eg, X221, X222) are deprecated and newer versions (eg X221A1) do have fixtures. It would still be useful to add these fixtures to ensure the new grammar is backward compatible and can parse older versions.