Phlip
2/23/2009 5:28:00 AM
> Then /^you should see an? (.+) element$/ do |searcher|
> @xdoc.css(searcher).should_not be_nil
> end
Nooop. I forgot to test that in the negative - by changing the Then commandment,
and seeing if it fails cleanly. It did not, possibly because a failing CSS hit
does not return a nil.
After changing to should_not be_blank, I then upgraded the verbiage in the
featurizer:
Then /^you should see an? (.+) (.+)$/ do |style, element|
element = { 'image' => 'img' }.fetch(element, element)
@xdoc.css("#{element}.#{style}").should_not be_blank
end
....
When you go to /
Then you should see a comic image
The {} is speculative coding; if I had a real client asking for these features,
they might write 'panel', which I must then translate to <div>...