jaimegildesagredo/expects — pull request #5 by jvrsantacruz (2013-07-16 22:40:44+00:00)
Title: Adds support for iterables in have.length

Attempts to use the len method and then falls back to enumerate each element by consuming the whole collection one at the time.

The whole collection is consumed in the operation so the iterable becomes inusable after checking it.
Really long iterables won't consume extra memory, as it is visited one item at the time.
Beware of checking length on infinite iterables, which will punish the user severely for trying to reach valhalla.