Coder Social home page Coder Social logo

sethherr / guard-test Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guard/guard-test

0.0 3.0 0.0 270 KB

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

Home Page: http://rubydoc.info/gems/guard-test/frames

License: MIT License

Ruby 100.00%

guard-test's Introduction

Guard::Minitest is a better alternative to Guard::Test, you should definitely check it out: https://github.com/guard/guard-minitest. ❗

Guard::Test

Gem Version Build Status Dependency Status Code Climate Test Coverage

Guard::Test allows to automatically & intelligently launch tests when you create or modify files.

  • Compatible with Test::Unit 2.
  • Tested against Ruby 2.1, 2.2, Rubinius & JRuby (1.9 mode only).

Install

Please be sure to have Guard installed before continuing.

Add the gem to your Gemfile (inside the :development or :tool group):

group :development do
  gem 'guard-test'
end

Add guard definition to your Guardfile by running this command:

$ guard init test

Ruby on Rails

Ruby on Rails lazy loads gems as needed in its test suite. As a result Guard::Test may not be able to run all tests until the gem dependencies are resolved.

To solve the issue either add the missing dependencies or remove the tests.

Example:

Specify ruby-prof as application's dependency in Gemfile to run benchmarks.

Rails automatically generates a performance test stub in the test/performance directory which can trigger this error. Either add ruby-prof to your Gemfile (inside the test group):

group :test do
   gem 'ruby-prof'
end

Or remove the test if it isn't necessary.

Usage

Please read the Guard usage doc.

By default, Guard::Test watch for files matching test_*.rb or *_test{s,}.rb in the test directory (you can change this directory with the test_paths option, see below).

Guardfile

See the template Guardfile for some examples.

Please read the Guard documentation for more info about the Guardfile DSL.

Options

Deprecation notice: The :runner option is deprecated. If you had set it to "fastfail", it is now the default in test-unit 2, but if you want the opposite, you can pass the cli: '--no-show-detail-immediately' option instead.

Available options

bundler: false          # Whether or not to use `bundle exec` to run tests, default: true (if a you have a Gemfile in the current directory)
rubygems: true          # Whether or not to require rubygems (if bundler isn't used) when running the tests, default: false
rvm: ['1.9.3', 'jruby'] # Directly run your specs against multiple Rubies, default: nil
spring: true            # Run your tests with [`spring`](https://github.com/jonleighton/spring), default: false
zeus: true              # Run your tests with [`zeus`](https://github.com/burke/zeus), default: false
drb: true               # Run your tests with [`spork-testunit`](https://github.com/timcharper/spork-testunit), default: false
include: ['foo', 'bar'] # Pass arbitrary include paths to the command that runs the tests, default: ['test']
cli: 'color'            # Pass arbitrary CLI arguments to the command that runs the tests, default: nil
all_on_start: false     # Run all tests on Guard startup, default: true.
all_after_pass: false   # Run all tests after the current run tests pass, default: true
keep_failed: false      # Re-run failing tests until they pass, default: true
test_paths: ['spec']    # Array of paths that where are located the test files, default: ['test']

spring option

Important: The spring testunit command of official version 0.0.8 of spring is running only file specified as first argument, other are ignored. Fortunately this issue has been fixed recently in spring master and all test files given in arguments are invoked, see #102. However that has not been packaged yet, therefore while waiting for spring 0.0.9 release we recommend to use (in your Gemfile):

gem 'spring', github: 'jonleighton/spring'

zeus option

When true, the include option is disregarded, as it does not work with zeus' test runner.

The zeus server process (zeus start) must already be running in another terminal (you can use guard-zeus for that).

drb option

When true, notifications are disabled. This might be fixed in future releases.

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 must pass on Travis CI.
  • Update the Yard documentation.
  • 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).

Author

Rémy Coutable

Contributors

https://github.com/guard/guard-test/graphs/contributors

guard-test's People

Contributors

rymai avatar alekseykulikov avatar e2 avatar voidus avatar lluis avatar coderjoe avatar pastorius avatar dasch avatar genericsteele avatar jamezilla avatar michiels avatar sch0rsch avatar nishidayuya avatar carlost avatar pgaertig avatar

Watchers

James Cloos avatar Seth Herr avatar  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.