Making Fixtures

  • Mar 29, 2013
  • 0 Comments
This week, I worked on creating a system that would export Code Tests as fixtures instead of saving them to the database. Saving tests as fixtures means that they can be stored independently of any database--that is to say, once tests are written, they can be available in any branch, not just a localhost or test site where they get uploaded. Which means that once badge tests are written, badges can become a part of any branch that needs them.

So first this week I tackled an operation to "Export" a test as a fixture (save it on a local computer) which was actually not that hard thanks to a library that Kyle showed my called SnakeYaml (YAML being the format that we are using to save fixtures). Being able to "Import" a test back into the IDE proved a little more difficult, since it involved being able to translate from the strings and integers stored on the server into Croquet operations. However, it's a good thing I worked on this now--all of the Croquet operations are now there for when I have to write code that loads Code Tests from the community in the future.

Although I haven't done horrendously rigorous testing, it seems like all different types of Code Tests are now able to be saved locally as fixtures, and loaded back into the IDE (and then potentially saved again under a different ID, loaded, etc...)

Comments

  • No comments yet

Log In or Sign Up to leave a comment.