Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Object containing matcher #100

Merged
merged 8 commits into from Nov 18, 2011

Conversation

Projects
None yet
4 participants
Owner

slackersoft commented Jun 17, 2011

New matcher for toHaveBeenCalledWith() expectations. Similar to ruby's hashContaining.

Also ended up adding jasmineToString and jasmineMatches for objectContaining and jasmine.any so Any doesn't have to be a specific special case in pretty print or matchers anymore

searls commented Jun 17, 2011

+1 This is pretty slick. Jasmine spies need more matchers like this one.

Contributor

infews commented Jun 19, 2011

Greg - I'd like a walkthrough of this at work (if you don't mind). I get the intent, but am a little confused about the implementation. And yes, this is slick. Tied together with some improved reporting on toHaveBeenCalledWith I think spies will make even more sense to people.

Contributor

ragaskar commented Jul 23, 2011

Yeah, this looks great -- story here: pivotal#100 ..

Owner

slackersoft commented Aug 17, 2011

Additionally, I just realized that while typeof(null) === "Object", jasmine.any(Object) doesn't match null. I have another commit we should talk about that sits on top of this pull request.

https://github.com/gvanhove/jasmine/commit/c608e03aac99c6fe6bfceb0f0f70dc88313948ce

infews pushed a commit that referenced this pull request Nov 18, 2011

Merge pull request #100 from gvanhove/objectContaining
Merging after verifying locally that all specs are green (node, browser)

@infews infews merged commit b4439f7 into jasmine:master Nov 18, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment