how do you run a specific test?

18 views
Skip to first unread message

Daniel Choi

unread,
Dec 11, 2008, 12:13:58 PM12/11/08
to shoulda
I know that with Test::Unit, you can run a specific test like so

ruby test/unit/user_test.rb --name test_reset_password

How can I run specific shoulda tests?

Dan Croak

unread,
Dec 11, 2008, 12:48:53 PM12/11/08
to sho...@googlegroups.com
Daniel,

Since shoulda is built on top of Test::Unit, you can run specific
tests the same way. I usually use regular expressions with some unique
part of the test:

ruby test/unit/user_test.rb -n "/reset password/"

That's easier than trying to concatenate the context text with the
should text.

Dan Croak
http://thoughtbot.com

Daniel Choi

unread,
Dec 11, 2008, 3:04:09 PM12/11/08
to shoulda
Thanks


On Dec 11, 12:48 pm, Dan Croak <dcr...@thoughtbot.com> wrote:
> Daniel,
>
> Since shoulda is built on top of Test::Unit, you can run specific  
> tests the same way. I usually use regular expressions with some unique  
> part of the test:
>
> ruby test/unit/user_test.rb -n "/reset password/"
>
> That's easier than trying to concatenate the context text with the  
> should text.
>
> Dan Croakhttp://thoughtbot.com

James Golick

unread,
Dec 11, 2008, 3:05:09 PM12/11/08
to sho...@googlegroups.com
I have some vim functions and mappings for this... i.e. run current should, or run current context

If anybody is interested, I'll github them.

Tammer Saleh

unread,
Dec 11, 2008, 3:10:11 PM12/11/08
to sho...@googlegroups.com
James,

definitely interested in that.

James Golick

unread,
Dec 11, 2008, 3:25:25 PM12/11/08
to sho...@googlegroups.com
Hey Tammer,

You need this: http://github.com/giraffesoft/dotfiles/tree/master/vim/plugin/custom_ruby_stuff.vim

and... http://github.com/giraffesoft/dotfiles/tree/master/vimrc#L43 plus the line down from it are the mappings that I have them set to.

The python script is not the DRYest thing ever, but hey - I'm lazy, and it's just my editor customizations afterall :-)

J.
Reply all
Reply to author
Forward
0 new messages