A simple Ruby webserver for your testing infrastructure

On occasion, I run into the need to host some files on a web server to perform some testing. Whether it’s testing an embedded solution on smart, multi-function printers, serving files for mobile testing or facilitating some piece of automation, it’s nice to have a throw away web server when you need it.

Several scripting languages can pull this off, but since I’m partial to Ruby, I thought I’d offer up the Ruby flavored one-liner I use on occasion. I find this useful as it’s easy to just whip out on a command line any time I need it or fold it into more complex workflows.

Just type this in at the command line, assuming you have Ruby installed, and you’ll have a simple little file server up and running in seconds:

ruby -run -e httpd . -p 5000

Just a quick breakdown on what we’ve done here:

ruby -run -e
httpd .
-p 5000

To kill it, a simple CTRL + c will end your process.

I have a log hoarder version I’ll share later.


Now read this

Ranking bugs

I recently ran across a well-intentioned request on StackExchange’s beta Software Quality Assurance and Testing group on ranking defects. Something to do with locating a good bug matrix to use. This would have been my response, had... Continue →