Ruby 2.0 tests#194
Conversation
|
Works good for me 👍 |
spec/httparty_spec.rb
Outdated
There was a problem hiding this comment.
What does this even do? Does it work on 1.8 and 1.9 as well?
There was a problem hiding this comment.
When I wrote that I tested briefly the cases where proc equality should be true and false with RubyVM::InstructionSequence#of. It seemed to be doing what I thought. Now however with a clear mind, it seems it is not, and it makes sense that it couldn't. Proc equality is a very complicated issue.
a = RubyVM::InstructionSequence.of -> { 1 + 2 }
b = RubyVM::InstructionSequence.of -> { 1 + 2 }
puts a == bIf this was functional code that would display true. Sadly it doesn't.
There was a problem hiding this comment.
So the main goal is to test that the parent and child do not have the same proc. I suppose we could just make the procs return something that is known, like 1 + 2 for parent and 2 + 2 for child. We could then just test that the procs return the correct value when called, instead of using equality as the test.
There was a problem hiding this comment.
Yea exactly what I was thinking.
Quick question for you though. I'm trying to imagine why you are duplicating the procs for every subclass of HTTParty, is it just a security to prevent someone from hacking into the procs and changing what they do. That's the best I could think of.
There was a problem hiding this comment.
Trying to remember. I'm thinking it had to do with memcache and marshaling or something. It was a pull request, not something I invented, as most of httparty is.
|
Everything is passing except deciding on how to handle backward compaitibility with the |
spec/httparty_spec.rb
Outdated
There was a problem hiding this comment.
Should this be testing equality? Seems like it should be the same as below.
There was a problem hiding this comment.
I'm not 100% sure what you mean, my change tests the call value of the proc for equality, and keeps the test for the proc not being the same object.
There was a problem hiding this comment.
I thought the point of changing the block and swapping out the equality check for the invocation check was because the equality check didn't work, but the @parent is still using the equality check.
There was a problem hiding this comment.
Oh I see what you mean, yea that makes perfect sense.
There was a problem hiding this comment.
This fixes the cucumber issues with subclass exceptions not counting as raised.
|
Is there anything left outstanding on this I can fix? |
see #193 for information on these changes.