module RSpec::Mocks::Methods

def format_chain(*chain, &blk)

def format_chain(*chain, &blk)
  if Hash === chain.last
    hash = chain.pop
    hash.each do |k,v|
      chain << k
      blk = lambda { v }
    end
  end
  return chain.join('.').split('.'), blk
end