What goal do you have in mind for this test? From the examples you gave, it looks like you are only testing how RSpec’s verifying doubles work. For example, this expectation:
expect(html).to respond_to(:parse).with_keywords(:body, :headers)
…isn’t exercising your code at all, because you’ve declared html as a test double, so it’s just testing how doubles work. If you’re trying to test the HTML class, you should not use a double in its place. Test doubles are intended for when you want to control the environment in which you test something, by replacing some collaborators with fake versions. They’re not intended to ever replace the thing you are testing—once you do that, you’re no longer testing the thing.
Myron
--
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 rspec+unsubscribe@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/8dbe9153-45c0-44f7-a0be-e6fa6ceffd7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
I guess I was hoping that when the instance double verified that the message matches the method signature it would determine that I was trying to use keyword arguments instead of a hash.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/e9ba5c1c-bbed-4b71-84d3-078d31fd7a5f%40googlegroups.com.