satRdays / badgeR

badgeR R package
1 stars 3 forks source link

Adding tests but does it require a little refactoring our code? #15

Open brennanpincardiff opened 4 years ago

brennanpincardiff commented 4 years ago

Clearly we need some tests but I wonder if it requires some refactoring.

I wonder if it is possible/worthwhile to separate the creation of the temp_badge_code item from the creation of the Latex and perhaps from the generation of the PDF?

This might facilitate some previewing and facilitate some testing.

Maybe into the following functions:

Thoughts @dokato, @DaveParr? P

dokato commented 4 years ago

+1 to that. The code would definately benefit from some refactoring.

Minor remarks:

make_badge_code() -> make_badge_template()

~preview_badge() what would be the preview? Is there an easy way to show a popup with pdf in R?~ EDIT: forget the last one, just saw #13 ;)

brennanpincardiff commented 4 years ago

One test added :-)