Code Monkey home page Code Monkey logo

guard-minitest's Introduction

Guard::Minitest

Minitest guard allows to automatically & intelligently launch tests with minitest framework when files are modified.

  • Compatible with MiniTest 1.7.x & 2.x

  • Tested on Ruby 1.8.6, 1.8.7 & 1.9.2.

Install

Please be sure to have guard installed before continue.

Install the gem:

gem install guard-minitest

Add it to your Gemfile (inside test group):

gem 'guard-minitest'

Add guard definition to your Guardfile by running this command:

guard init minitest

Usage

Please read guard usage doc

Guardfile

Minitest guard can be really be adapated to all kind of projects. Please read guard doc for more info about Guardfile DSL.

Standard ruby gems with Minitest::Unit

guard 'minitest' do
  watch(%r|^test/test_(.*)\.rb|)
  watch(%r|^lib/(.*)([^/]+)\.rb|)     { |m| "test/#{m[1]}test_#{m[2]}.rb" }
  watch(%r|^test/test_helper\.rb|)    { "test" }
end

Standard ruby gems with Minitest::Spec

guard 'minitest' do
  watch(%r|^spec/(.*)_spec\.rb|)
  watch(%r|^lib/(.*)\.rb|)            { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r|^spec/spec_helper\.rb|)    { "spec" }
end

Options

You can force minitest seed with:

guard 'minitest', :seed => 12345 do
  ...
end

You can set minitest verbose mode with:

guard 'minitest', :verbose => true do
  ...
end

You can disable desktop notification with:

guard 'minitest', :notify => false do
  ...
end

You can disable bundler usage to run minitest with:

guard 'minitest', :bundler => false do
  ...
end

You can enable rubygems usage to run minitest (only if bundler is not present or disabale) with:

guard 'minitest', :rubygems => true do
  ...
end

If you use spork-testunit you can enable it with (you’ll have to load it before):

guard 'minitest', :drb => true do
  ...
end

Development

Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.

Authors

Yann Lugrin

guard-minitest's People

Contributors

yannlugrin avatar emmanuel avatar ezkl avatar oriolgual avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.