Stumbled across the awesome Grape framework for writing a simple REST server for a small project I’m messing with. Since I was trying to write tests right out of the gate instead of using curl to do everything, I immediately started trying to get Rest::Test to work, which was failing miserably.
After googling and playing around for awhile, I did eventually get it. It was mainly with how to setup the app function, which didn’t make a lot of sense when config.ru uses the run function to get itself going.
I figured I’d just post this code below so if anyone else runs into this issue, they’ll have the answer. This is using MiniTest and Ruby 1.9.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |