0.3.0 • Published 3 years ago

unexpected-generator v0.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

unexpected-generator

Depfu Build Status

http://www.shalominthewilderness.com/2013/07/horse-progress-days.html

Plugin for unexpected providing support for generators and iterators. It adds a type for iterators. Generators are tested by testing the iterator resulting from calling them.

Assertions

<iterator> [not] to be done

Asserts that the iterator is done, and that no further calls to next() will yield. Negating it to assert that it does yield will cause the iterator to advance one step, but any value is discarded.

<iterator> to yield item <any>

Asserts that the iterator yields, and that the value yielded matches the given item.

<iterator> to yield items <array>

Asserts that the iterator yields enough times and the correct items to match the list of items given in the array. If it is done before yielding the expected amount of items, the assertion will fail.

<iterator> to be done with <any>

Sends the given value to the iterator as a parameter of the next() call, and expects the iterator to be done at this point. If the iterator instead yields, the assertion fails.

<iterator> yielding with <any> <assertion?>

Sends the given value to the iterator as a parameter of the next() call, and shifts the resulting value to the following assertion, if any. If the iterator is done, this assertion fails.


MIT Licensed, © 2017 Gert Sønderby

0.3.0

3 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

6 years ago

0.1.0

6 years ago