The reason I want something like this is I have a library we wrote for a REST framework. It has some client and then the actual methods get called via a method_missing on some base class. For example
class BaseService
def initialize
@client = FooRestFramework::Client.new
end
def method_missing(name, *args, &block)
@client.send(name, *args, &block)
end
end
class BarService < BaseService
end
then say there's some rspec or whatever
describe BarService do
describe '#do_rest_thing' do
it 'has the correct result or whatever' do
expect(subject.do_rest_thing).to eq 5
end
end
end
and that #do_rest_thing method actually is the #method_missing and eventually calls some HTTP method on some REST service somewhere
I can't think of a way with simplecov to know which methods I called since those methods don't really exist.
Any thoughts?
- Ben