lib/spec/api/sugar.rb in rspec-0.6.0 vs lib/spec/api/sugar.rb in rspec-0.6.1
- old
+ new
@@ -16,10 +16,11 @@
return original_method_missing.bind(self).call(sym, *args, &block) unless __is_sweetened?(sym)
object = self
calls = sym.to_s.split("_")
while calls.length > 1
- break if (object.respond_to?calls.join("_"))
+ remainder = calls.join("_")
+ break if (object.respond_to?(remainder))
call = calls.shift
object = object.__send__(call)
break if call == "be"
end
return object.__send__(calls.join("_"), *args, &block)
\ No newline at end of file