From: Phlip Date: 2009-02-23T14:29:29+09:00 Subject: Re: [ANN] nokogiri 1.2.0 Released > 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
...