Musings about Entrepreneurship, Technology and Software Development

Accidental Technologist

  • Home
  • About
  • Still River Software
  • Privacy Policy

Minitest Not Running My Unit Tests

Tweet

I have started using minitest for Rails 3.x unit testing and since it comes with Ruby 1.9.x by default, it seems like a good direction to take my testing.

I am using the great gem by Mike Moore called minitest-rails which has a minitest dependency so I can easily have the latest version of minitest. ?This gem helps to more cleanly integrate and use minitest in our Rails 3.x projects.

As part of my setup I use Autotest so my tests run automatically when files change. ?I noticed none of my unit tests were running and upon further inspection, minitest was looking in test/unit and test/unit test directories but not in the test/models folder, which seems to be the minitest default. ?

Opening up my .autotest configuration file and adding the following:

Autotest.add_hook :initialize do |at|
?at.add_mapping(/test\/models\/.*\.rb/) do |_, m|
??at.files_matching %r%^test/(models)/.*\.rb$%
?end
end

After restarting autotest, my unit tests are now being tested. ?I hope this saves someone some time.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

September 17, 2012 Posted in Ruby on Rails Tagged With: autotest, minitest, rails, Ruby, unit testing

Popular Posts

  • 10 Alternative Ruby Web Frameworks
  • 7 Resources Every JavaScript Developer Should Know
  • Setting up SQLite3 for Ruby on Rails Development
  • Running Rails 3 on Windows
Micro.blog

Categories

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Latest Tweets

  • RT @dhh: Away CEO apologies for past bad behavior, then continues the abuse in the afternoon. How incompetent do you have to… https://t.co/LEIoyv7hy1

    1 day ago
  • Amazon is really screwing up with their deliveries this holiday season. As a Prime member I usually get shipments i… https://t.co/ihyf16Yyc4

    1 day ago
  • Reading @Avdi’s tweets about trying to get a tech job are depressing. It’s sad the process doesn’t respect the cand… https://t.co/Zkt9vBh9cL

    1 day ago
  • After upgrading to iPadOS, my iPad Pro gets terrible battery life. Come on @Apple, get your act together.

    2 days ago
  • RT @scottw: Tailwind CSS - Next to Rails no other library, tool, framework has done more to make it easier to ship new things t… https://t.co/MXMo3hVAfZ

    5 days ago

Tags

Agile amazon Android Apple App Store ASP.NET MVC book bootstrapping Business conference Customer Service Droid X email entrepreneurship functional programming Google InfoQ InstantRails iOS iPad iPhone JavaScript mac microconf Microsoft mixergy mobile objective-c Open Source podcast rails Rails3 railsconf RSS Ruby Ruby on Rails scala sinatra Software swift twitter Windows WordPress WPEngine xcode

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2019 · Genesis Minimal Notebook on Genesis Framework · WordPress · Log in

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.