Thanks for all the ideas. I just rolled my own which expects a block with an
assertion in it:
https://gist.github.com/1228927
Could we put this into RSpec somewhere? I'd rather not dump the source into The
Cucumber Book - it's too low level. I could put it into it's own little gem but
that see
I am doing:
page.should have_xpath("//img[contains(@class, 'foobar')]", :count => 0)
but cucumber tells me:
expected xpath "//img[contains(@class, 'foobar')]" to return something
(RSpec::Expectations::ExpectationNotMetError)
... Shouldn't this be returning true/false ?
Patrick J. Col
On Sep 20, 2011, at 11:45 PM, Patrick J. Collins wrote:
> I am doing:
>
> page.should have_xpath("//img[contains(@class, 'foobar')]", :count => 0)
>
> but cucumber tells me:
>
> expected xpath "//img[contains(@class, 'foobar')]" to return something
> (RSpec::Expectations::ExpectationNotMe
"have_[xpath]" is a custom matcher in Capybara. So, the answer would be no.
https://github.com/jnicklas/capybara/blob/master/lib/capybara/rspec/matchers.rb
On Sep 20, 2011, at 3:45 PM, Patrick J. Collins wrote:
> I am doing:
>
> page.should have_xpath("//img[contains(@class, 'foobar')]",
On Tue, Sep 20, 2011 at 4:55 AM, Matt Wynne wrote:
> Thanks for all the ideas. I just rolled my own which expects a block with an
> assertion in it:
I love the language!
eventually { white.should be_black }
> Could we put this into RSpec somewhere?
It's not actually RSpec-specific. I'll pu