Archive of posts with category 'Testing'

Testing PyROOT is Working

If you’ve compiled ROOT to use python, you need to find out if it’s working correctly. The following code will do that:

Handy Trick

If you have some sample code in a ruby file that you want to run ONLY when that file is called directly, enclose it in the following if statement.

Cloudflare

I just put coldandheartless.com on Cloudflare. It sounds like something that would be really helpful and I figured I’d give the free version a try before I move another domain to the paid version. It was incredibly easy to set up, which was great. Took basically a single click in my Badger account to enable Cloudflare and then put in the new dns values. I’ll admit that I don’t exactly know how it all works, but so far it seems pretty cool. I did see that there’s a wordpress plugin for Cloudflare and I’ll probably install that next.

Rails Integration Tests

After unit tests, for me, the important tests are integration tests. This is where I can test logging in and checking authorizations and calculations. They are a bit more involved, but not too difficult once you get the hang of them.

Rails Unit/Functional Tests

In my latest rails project, I am trying to write good tests for everything important. My first tests were all unit tests. These are pretty easy. All they basically do is make sure that the data that’s stored in the database is formatted properly. So I have a bunch of tests that make sure that my validations are correct. A sample test looks like this: