Giter Site home page Giter Site logo

dsnider / guard-minitest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guard/guard-minitest

0.0 1.0 0.0 278 KB

Guard::Minitest automatically run your tests (much like autotest)

Home Page: https://rubygems.org/gems/guard-minitest

License: MIT License

Ruby 100.00%

guard-minitest's Introduction

Guard::Minitest

Gem Version Build Status Dependency Status Code Climate Coverage Status

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

  • Compatible with minitest >= 2.1 (optimal support for 5.x).
  • Tested against Ruby 1.8.7, 1.9.3, 2.0.0, JRuby (1.8 mode & 1.9 mode) & Rubinius (1.8 mode & 1.9 mode).

Install

Please be sure to have Guard installed before continue.

The simplest way to install Guard::Minitest is to use Bundler.

Add Guard::Minitest to your Gemfile:

group :development do
  gem 'guard-minitest'
end

and install it by running Bundler:

$ bundle

Add guard definition to your Guardfile by running the following command:

guard init minitest

Usage

Please read Guard usage doc

Guardfile

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

Standard Guardfile when using 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 Guardfile when using 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

List of available options

:all_on_start => false      # run all tests in group on startup, default: true
:cli => '--test'            # pass arbitrary Minitest CLI arguments, default: ''
:test_folders => ['tests']  # specify an array of paths that contain test files, default: %w[test spec]
:test_file_patterns => true # specify an array of patterns that test files must match in order to be run, default: %w[*_test.rb test_*.rb *_spec.rb]
:spring => true             # enable spring support, default: false
:zeus => true               # enable zeus support; default: false
:drb => true                # enable DRb support, default: false
:bundler => false           # don't use "bundle exec" to run the minitest command, default: true
:rubygems => true           # require rubygems when run the minitest command (only if bundler is disabled), default: false

Options usage examples

You can change the default location of test files using the :test_folders option and pattern of test files using the :test_file_patterns option:

guard :minitest, :test_folders => 'test/unit', :test_file_patterns => '*_test.rb' do
  # ...
end

You can pass any of the standard MiniTest CLI options using the :cli option:

guard :minitest, :cli => '--seed 123456 --verbose' do
  # ...
end

Spring is supported (Ruby 1.9.X / Rails 3.2+ only), but you must enable it:

guard :minitest, :spring => true do
  # ...
end

Zeus is supported, but you must enable it. Please note that notification are currently disabled when using Zeus, if you're interested in adding notification support for Zeus, please open a new issue.

guard :minitest, :zeus => true do
  # ...
end

Spork / spork-testunit is supported, but you must enable it:

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

Roadmap

  • Add notification support when using zeus.

Development

Pull requests are very welcome! Please try to follow these simple rules if applicable:

  • Please create a topic branch for every separate change you make.
  • Make sure your patches are well tested. All specs run by Travis CI must pass.
  • Update the README.
  • Please do not change the version number.

For questions please join us in our Google group or on #guard (irc.freenode.net).

Maintainer

Rémy Coutable (@rymai, rymai.me)

Author

Yann Lugrin

guard-minitest's People

Contributors

yannlugrin avatar rymai avatar kejadlen avatar leemhenson avatar manewitz avatar chadoh avatar itzki avatar sbl avatar gma avatar japgolly avatar arronmabrey avatar bmorearty avatar dsnider avatar emmanuel avatar erkan-yilmaz avatar ezkl avatar statianzo avatar grimen avatar sbleon avatar nathany avatar oriolgual avatar sometimesfood avatar wilkerlucio 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.