In case you wondered: The opinions expressed in this email are my own
and do not necessarily reflect the views of any former, current or
future employers of mine.
I’m not crazy about this “feature”. We already have a pending
mechanism for steps (not defining them). What does this bring to the
table over just not defining a step?
Matt - I’m pretty sure that will work - give it a shot, OK?
That won’t work. It will raise a “undefined local variable or method
`pending’”
Yeah the trouble is it fails with the following error:
Spec::Example::ExamplePendingError
Which cucumber doesn’t understand as anything other than a complete
fail.
Our workaround we’ve arrived at (thanks Aslak for pointing out the
obvious that we’d missed!) is to just write PENDING at the end of the
regex for the step matcher so it doesn’t match on the step in the
feature file.
@Aslak - Interestingly, when we do this and make the Given step
pending, cuc still tries to run the When / Then steps for that
scenario. Sounds like a bug to me - should we raise a ticket on
lighthouse or did I miss something?
In case you wondered: The opinions expressed in this email are my own
and do not necessarily reflect the views of any former, current or
future employers of mine.
@Aslak - Interestingly, when we do this and make the Given step pending, cuc
still tries to run the When / Then steps for that scenario. Sounds like a
bug to me - should we raise a ticket on lighthouse or did I miss something?
Currently, only a failure (red) will cause subsequent steps to be
skipped.
In case I’ve missed something, would you mind elaborating on the
intent of that design? Under what circumstances would you want it to
carry on running the scenario if some of the context (Given…)
wasn’t set up?
In case you wondered: The opinions expressed in this email are my own
and do not necessarily reflect the views of any former, current or
future employers of mine.
Doesn’t work for us, either. I think David must have some funky rspec
requirey stuff going on.
We see this:
Scenario: Can see the profile page for a user who has a great amount
of details specified
Given there is a user with all conceivable attributes and
attachments
implementation of attachments for users
(Spec::Example::ExamplePendingError)
/home/nfelger/dev/skweb/vendor/plugins/rspec/lib/spec/example/
pending.rb:13:in pending' ./features/steps/profile_steps.rb:14:in Given “there is a user
with all conceivable attributes and attachments”’
features/visitor/profile.feature:13:in `Given there is a user
with all conceivable attributes and attachments’
In case you wondered: The opinions expressed in this email are my own
and do not necessarily reflect the views of any former, current or
future employers of mine.
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 a feature narrative, it may not seem to have value writing a
particular message vs seeing the default pending one…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 use pending ever 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 ==
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 these pending statements
to remind us in a couple days when we come back to this story.
Anyway, I have a feeling I could have implemented this feature in 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.
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?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.