github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

grosser / single_test

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 12
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (2)
    • v0.3.0
    • v
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Rake tasks to invoke single tests/specs with rakish syntax — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

readme tip 
grosser (author)
Mon Jan 11 06:13:52 -0800 2010
commit  8831e33e3a718d79f41362a2060d9e910a381834
tree    552759b214ac882d014cb6a9bd07e46e52916844
parent  8595091fa4ba25673b2e861e600fd883cf5fa57d
single_test /
name age
history
message
file README.markdown Mon Jan 11 06:13:52 -0800 2010 readme tip [grosser]
file Rakefile Sun Dec 13 01:27:53 -0800 2009 add gemification for mr pupeno [grosser]
file VERSION Sun Dec 13 01:29:06 -0800 2009 add version/gemspec [grosser]
directory lib/ Sun Dec 13 01:14:42 -0800 2009 add load_tasks in preparation for gemification [grosser]
file single_test.gemspec Sun Dec 13 01:29:09 -0800 2009 Regenerated gemspec for version 0.3.0 [grosser]
directory spec/ Sun Dec 13 01:14:42 -0800 2009 add load_tasks in preparation for gemification [grosser]
directory tasks/ Thu Sep 17 08:42:20 -0700 2009 added spec/test:last simplified readme [grosser]
README.markdown

Runs a single test/spec via rake.

USAGE

As Rails plugin:

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

As Gem: sudo gem install single_test

# in your Rakefile require 'single_test' SingleTest.load_tasks

Single test/spec

rake spec:user          #run spec/model/user_spec.rb (searches for 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 u*hel*_test.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, if will use just spec for specs (which solves some issues)
  • run whole describe blocks: describe 'xxx' do describe 'yyy' --> rake spec:file:'xxx yyy'

TODO

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

AUTHOR

Michael Grosser
grosser.michael@gmail.com
Hereby placed under public domain, do what you want, just do not hold me accountable...

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server