Run specs with autotest, er, autospec!

It seems that it’s not well publicized, but if you want to run your RSpec files with autotest try autospec instead. It looks inside the spec/ directory for files named “*_spec.rb” by default for specs. autospec is part of the RSpec gem, and basically just sets up the proper environment and then shells out to autotest.

Also, if your files in lib/ match up with specs in spec/, autospec will automatically re-run your specs for changed files in lib/ on save. So if you have lib/foo/bar.rb, autospec will re-run lib/foo/bar_spec.rb when you save bar.rb.

Brandon Dimcheff
Brandon Dimcheff
Chief Architect

Brandon Dimcheff is a software engineer born and raised in Ann Arbor, Michigan. He uses go for his day job, has fallen in love with Kubernetes, is an aspiring functional programming language nerd, and is an advocate of open source.