[rspec-users] Phlip's be_html_with was RE: Problem with Custom matcher and Blocks
Brandon Olivares
programmer2188 at gmail.com
Sun Apr 5 04:29:03 EDT 2009
Hi,
Thank you very much.
Is there any documentation of the rest of assert2? I found a web site I
think (assuming it's the same thing), but there wasn't really documentation
for assert_xhtml or assert_rjs.
Brandon
> -----Original Message-----
> From: rspec-users-bounces at rubyforge.org [mailto:rspec-users-
> bounces at rubyforge.org] On Behalf Of Phlip
> Sent: Sunday, April 05, 2009 12:09 AM
> To: rspec-users at rubyforge.org
> Subject: Re: [rspec-users] Phlip's be_html_with was RE: Problem with
> Custom matcher and Blocks
>
> Brandon Olivares wrote:
>
> > I'd appreciate it if you could let me know about the be_html_with
> issue when
> > you can though, as I like the natural language better.
>
> Add this monkey patch below require 'assert2/xhtml':
>
> class BeHtmlWith
> def matches?(stwing, &block)
> @block ||= block
> @scope.wrap_expectation self do
> @doc = Nokogiri::HTML(stwing)
> return run_all_xpaths(build_xpaths)
> end
> end
> end
>
> Now, I'm off to finish manual tests of the new assert_rjs, and to pop a
> new
> version...
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
More information about the rspec-users
mailing list