[rspec-users] Unimplemented Spec idea

Daniel N has.sox at gmail.com
Tue Jul 31 23:04:27 EDT 2007


On 8/1/07, David Chelimsky <dchelimsky at gmail.com> wrote:
>
> On 7/31/07, Daniel N <has.sox at gmail.com> wrote:
> >
> >
> > On 8/1/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
> > >
> > > I absolutely love the unimplemented spec idea, and tend to use it a
> > > lot.  But occasionally it gets in my way, when I rush to write a
> > > spec, and then want to change it to a non-implemented spec.  My
> > > normal solution is to comment out the do...end block.  Is there a
> > > better way?
> > >
> > > Stealing an idea from Dan North, how about something like this:
> > >
> > > it "should do such and such", :pending => true do
> > >     # unimplemented spec goes here
> > > end
> > >
> > > To make the spec run, simply remove the :pending key.  I'm sure this
> > > would be rather trivial to implement as well.
> > >
> > > Thoughts?
> > >
> > > Scott
> >
> >
> >  This is already included.  At least it is in edge. You call the
> pending(
> > "some reason" ) method at the top of your example to do this.
> >
> >  it "should do stuff" do
> >    pending( "Don't run this yet" )
> >    # specs go here for unimplemented feature
> >  end
>
> You can also do this:
>
> it "should not do this buggy thing" do
>   pending "awaiting bug fix" do
>     # buggy code
>   end
> end
>
> When the code in the block fails, the example shows up as pending.
> When it passes, it shows up as a failure, saying that the failure was
> expected but it passed instead.


That's good to know :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070801/7d26b20c/attachment.html 


More information about the rspec-users mailing list