Skip to content

Instantly share code, notes, and snippets.

@stalniy
Created June 25, 2018 18:29
Show Gist options
  • Save stalniy/81222d2596a74c44cfe34eb91bfe8b25 to your computer and use it in GitHub Desktop.
Save stalniy/81222d2596a74c44cfe34eb91bfe8b25 to your computer and use it in GitHub Desktop.
Lazy vars shared examples
sharedExamplesFor('Collection', function() {
it('is empty by default', function() {
expect($subject).to.be.empty;
});
it('increments "length" property when adds a new item', function() {
$subject.add(1, 2, 3);
expect($subject).to.have.length(3);
});
it('can remove item', function() {
$subject.add(1, 2);
$subject.remove(2);
expect($subject).not.to.contain(2);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment