[rspec-users] cucumber - mark a step as pending
dchelimsky at gmail.com
dchelimsky at gmail.com
Wed Sep 17 23:13:02 EDT 2008
On Sep 9, 11:16 pm, Pat Maddox <perg... at gmail.com> wrote:
> "aslak hellesoy" <aslak.helle... at gmail.com> writes:
> > On Tue, Sep 9, 2008 at 7:16 PM, David Chelimsky <dchelim... at gmail.com> wrote:
> >> Aslak - I think Matt is looking for this:
>
> >> Given /blah/ do
> >> pending
> >> end
>
> > I'm not crazy about this "feature". We already have apending
> > mechanism for steps (not defining them). What does this bring to the
> > table over just not defining a step?
>
> The main reason is that you can have meaningful messages. Those are
> just good in general. And I'll admit that when you're sitting down to
> write afeaturenarrative, it may not seem to have value writing a
> particular message vs seeing the defaultpendingone...but for
> maintenance it can be very helpful.
>
> In fact, here's an example that happened to me just today (example
> framework, not cucumber, but I rarely usependingever so when I do, I
> find it's because it's exceptionally handy):
>
> describe "book" do
> before(:each) do
> @book = Book.new :isbn => "12345678"
> end
>
> it "should know its amazon url" do
> @book.amazon_url.should == "http://amazon.com/ub/12345678"
> pending"need to figure out affiliate url format"
> end
>
> it "should know its borders url" do
> @book.borders_url.should == "http://search.borders.com?isbn=12345678"
> pending"need to figure out affiliate url format"
> end
> end
>
> Our initial story was to link to books using an affiliate code. But for
> all providers other than amazon, it was tough finding the right format.
> We're better off waiting a couple days until our accounts are available,
> then we can look at the internal docs for 2 minutes and figure it out.
> We got immediate business value today by just linking directly to these
> books from within the site. And now we've got thesependingstatements
> to remind us in a couple days when we come back to this story.
Is the idea that the steps still run but you get a TODO reminder?
That's a bit different from how we use pending in code examples.
I think that could be useful:
Then /the isbn should be (.*)/ do |isbn|
@book.borders_url.should == "http://search.borders.com?isbn=#{isbn}"
todo "need to figure out affiliate url format"
end
....
TODO:
need to figure out affiliate url format
./features/steps/books.rb:3:in `Given /the isbn should be (.*)/
As for the "pending" feature, let's say you have a new scenario with 5
new steps. As a matter of process, I'd like to see the output w/ the
snippets once, copy them all in to a ruby file, add pending to each of
them (maybe even have that already in the output) and now I'm just
working w/ code.
I think it makes the process easier.
More thoughts on that?
> Anyway, I have a feeling I could have implemented thisfeaturein the
> time it took to write this message. But I hope it's clear that it's
> something that would be valuable to some people, and harmless to the
> rest.
>
> Pat
>
> p.s. I believe a more correct action would be to split the story into
> two - the first which is to provide a UI for linking to books, and the
> second which is for adding the affiliate URLs. Finish the first story,
> and put the second one at the top of the queue, finishing it when the
> required information becomes available. But that's another discussion.
> _______________________________________________
> rspec-users mailing list
> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
More information about the rspec-users
mailing list