On 7 Jan 2010, at 19:15, David Chelimsky wrote:
> Cool. I'm not sure when I'll get to this, but I'm pretty sure this would work
> for you for now (untested):
>
> Spec::Matchers.define :include_all do |*expected|
> match do |actual|
> expected.all? {|e| actual.include?(e)}
> end
> end
>
> Spec::Matchers.define :include_any do |*expected|
> match do |actual|
> expected.any? {|e| actual.include?(e)}
> end
> end
Hi Ben/David
If it's any help, I've been using three extra matchers for a while now:
* include_all_once
* include_all_at_least_times
* include_any
I've put them in a gist[1], as the code to produce the error messages makes
them a bit verbose.
HTH
Ashley
[1] http://gist.github.com/271475
--
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users