Closed le0pard closed 10 years ago
@le0pard Wow, that's not a use case I foresaw, that the receiver would implement the method but return NoMethodError on purpose ;)
Thanks for the fix! Unfortunately it breaks all the 1.8.x builds. I'll investigate a bit, but feel free to also fix in the meantime for 1.8.x if you get to it first.
As soon as fixed for 1.8.x, I'll merge and do a release.
Ah, ok, I see the issue. I'll just go ahead and merge this, and then layer a more complete fix on top of it.
@ms-ati One moment, almost done :)
@le0pard ok, sure, no problem :+1:
@le0pard Oops, you have to use mime-type 1.25 on Ruby 1.8.x, do you want to do another conditional on that version?
@le0pard do you want to try:
if @__receiver__.respond_to?(method.to_sym)
Also, pretty please, could we have a test that fails without this fix?
@le0pard ok, everything passes on 1.8.7 on my end with that one.
May I suggest that you add a spec (since you already changed the format of all of them!) which simply sets up the analogous situation: the fallback object calls a non-existent method, such as 42.not_a_method
, and then we assert that the correct NoMethodError
is thrown all the way up?
If you don't want to add it, that's fine -- I can just add this spec after merging -- let me know.
One moment, will add such spec.
@le0pard
Perhaps change the gemspec section to something like:
if defined?(RUBY_ENGINE) && 'rbx' == RUBY_ENGINE
s.add_development_dependency 'rubysl'
s.add_development_dependency 'rubinius-coverage'
end
if !(defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
# Github flavored markdown in YARD documentation
# http://blog.nikosd.com/2011/11/github-flavored-markdown-in-yard.html
s.add_development_dependency 'yard'
s.add_development_dependency 'redcarpet', '2.3.0' # because 1.8
s.add_development_dependency 'github-markup'
end
Or let me know if you'd prefer that I do it, that's fine too.
Fixed. Just need wait for travis :)
Excellent job, thanks so much for chasing this down and getting it fixed! I'll merge and do a release.
@le0pard do you want to fix Rubinius now, or have you had enough for today? ;)
@ms-ati give me a moment :)
Is it this: https://github.com/rubinius/rubinius/issues/2794 or https://github.com/travis-ci/travis-ci/issues/1641?
It looks like you just need to change travis.yml
to have rbx instead of rbx-2.2.0?
Great. Last bit: in your new spec, you need the string to be a regex with (on|for)
, since on Rubinius, the exception is #<NoMethodError: undefined method
push' on nil:NilClass.>`
@le0pard Here's how to match an exception in RSpec using regex: https://www.relishapp.com/rspec/rspec-expectations/v/2-6/docs/built-in-matchers/raise-error-matcher#expect-specific-error-message-using-a-regular-expression
Finally! :beers:
Cheers man, I'll buy you a beer when you're next in Boston ;)
Released v1.1.3 with your fix!
Problem case: https://github.com/follmann/middleman-favicon-maker/issues/22#issuecomment-34058515