Testing Sinatra applications

I have been mucking around a bit more with my Sinatra application, running it via Rack with a config.ru file and some code improvements (though everything I write still looks like it was done by a ten-year-old) and I decided it ought to be fairly straightforward to prepare some test cases since I’m only handling two routes.

Not so. This is Ruby after all.

There’s quite a long testing page, http://www.sinatrarb.com/testing.html, but at no point does it give a command that will actually run the tests listed on the page! And none of the tests include POST data.

Every time I’ve tried to spend time figuring out how to run simple application tests with Rails, and now Sinatra, I just want to tear my hair out and just give up.

I know I’m a numpty coder, but it’s so difficult trying to do the right thing.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.