assert_select and xml:base

I trying to use assert_select to verify some xml content, where I specify an xml:base attribute:

<group xml:base='http://blah'/>

However I get an 'invalid selector' error when doing this

assert_select "group[xml:base='http://blah/']

I've tried variations like putting a blackslash in front of the colon, quoting xml:base etc., all to no avail. Anyone know how to do this?

Thanks!

Steve

stevemolitor wrote:

<group xml:base='http://blah'/>

However I get an 'invalid selector' error when doing this

assert_select "group[xml:base='http://blah/']

I've tried variations like putting a blackslash in front of the colon, quoting xml:base etc., all to no avail. Anyone know how to do this?

Try assert_xpath:

http://assertxpath.rubyforge.org/classes/AssertXPath.html#assert_xpath

I just recently tried it, with the REXML backend, on a <fb:else> tag, and it worked. I didn't put a colon in the predicate, though!

I don't know if assert_hpricot will work, from the same library, but REXML is tricky, so read this to learn the issue: