Project

testerobly

0.0
No release in over 3 years
Small test runner to launch alongside your developer session for immediate feedback.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 3.9.0
 Project Readme

testerobly

testerobly-flat

  • Listen for file changes and run matching tests.
  • Works with MiniTest out of the box.
  • Can be configured with custom commands to run individual and all tests.
  • Can be configured with custom matchers, matching changed files to specific tests.
  • Pause and skip during git operations like checkout.
  • Run all tests with Enter.
  • Fast, simple, stable and resource efficient.

Installation

Add it to your Gemfile's development group:

group :development do
  gem "testerobly"
end

Then bundle:

bundle install

# Recommended: adds bin/testerobly so you don't have to invoke it with "bundle exec testerobly"
bundle binstub testerobly

Rails specific configuration

Create config/testerobly.rb:

Testerobly.configure do |config|
  config.test_command = "bin/rails test %s" # "%s" will be replaced with the test file paths 
  config.test_all_command = "bin/rails test:all"

  # Optional on-change hook, allowing you to run custom tests when specific file or pattern changes
  # Called for every relative path that changed within your project directory
  config.on_change = Proc.new do |path, tests|
    case path
    when /^app\/models\/stepped\/.*\.rb$/, /^app\/jobs\/stepped\/.*\.rb$/
      tests << "test/models/stepped" << "test/jobs/stepped"
    end
  end
end

You can use the above configuration for other types of projects, not just Rails.

Usage

From your projects root directory run:

bundle exec testerobly
# OR if you installed the binstub
bin/testerobly

Appropriate tests will be run once you edit files. Press Enter to run the all tests command you configured.

Happy testing!

Development

PRs are welcome. To set up locally from within the checked out repo:

# Install dependencies
bundle

# Run commands with dev code
ruby -Ilib/ bin/testerobly