Tag Archives: testing

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.