GithubHelp home page GithubHelp logo

single_test's Introduction

Runs a single test/spec via rake.

INSTALLATION

###As Rails plugin

script/plugin install git://github.com/grosser/single_test.git

###As Gem

sudo gem install single_test

Include in your Rakefile:

require 'single_test'
SingleTest.load_tasks

USAGE

###Single test/spec Searches for test-files matching the given name.

rake spec:user          #run spec/model/user_spec.rb
rake test:users_c       #run test/functional/users_controller_test.rb
rake spec:admin/users_c #run spec/controllers/admin/users_controller_spec.rb
rake test:u*hel         #run test/helpers/user_helper_test.rb

Searches for test-files by class (Foo::Bar -> foo/bar)

rake spec:Foo::Bar #run spec/foo/bar_spec.rb

###Single test-case/example rake spec:user:token #run the first spec in user_spec.rb that matches /token/ rake test:user:token #run all tests in user_test.rb that match /token/

###Spec-server rake spec:user X= #run test on spec_sever (if one is running...), very fast for quick failure pin-pointing

###All one by one rake spec:one_by_one #run each spec/test one by one, to find tests that fail when ran rake test:one_by_one #on their own or produce strange output

###For last mofified file rake test:last rake spec:last

TIPS

  • if script/spec is missing, it will use just spec for specs (which solves some issues)
  • run whole describe blocks: describe 'xxx' do describe 'yyy' --> rake spec:file:'xxx yyy'
  • run single examples or describe blocks via line-numbers rspec spec/foo_spec:123

TODO

  • make test:last more clever e.g. lib -> try spec + spec/lib

Authors

Michael Grosser
[email protected]
Hereby placed under public domain, do what you want, just do not hold me accountable...

single_test's People

Contributors

grosser avatar sebbacon avatar lorrin avatar erkan-yilmaz avatar

Stargazers

 avatar  avatar

Watchers

James Cloos 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.