Hey,
If both the arrays are in order, you can use this solution.
a = ["h/1.h", "h/2.h"]
b = ["1.h", "2.h"]
a.zip(b) = [["h/1.h", "1.h"], ["h/2.h", "2.h"]]
a.zip(b).all? { |i, j| i.should include(j) }
Regards,
Smit -- <goog_1821628396>http://c42.in
On Thursday, 28 February 2013 11:10:42 UTC+5:30, Mattias A. wrote:
>
> Hi,
>
> I have array1 that contains several web address. Array2 contains the
> expected endings of array1 values. How can I control that arrays2 values
> is in array1?
>
> I have tried array1.should include array2, but it requires that array1
> and array2 is identical.
>
>
> array1 = ["https://..../page.html, https://..../page1.html,
> https://..../page3.html]
>
> array2 = ["page.html", "page2.html", "page3.html", "page4.html"]
>
> A big thanks in advance!
>
> Regards
> Mattias
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> [email protected] <javascript:>
> http://rubyforge.org/mailman/listinfo/rspec-users
>
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msg/rspec/-/XCGL7GrNiF8J.
For more options, visit https://groups.google.com/groups/opt_out.