def request_stub
      @request_stub ||= WebMock::RequestStub.new(:any, endpoint).tap{ |s| s.to_rack(app) }
    end
def request_stub
      @request_stub ||= WebMock::RequestStub.new(:any, endpoint).tap{ |s| s.to_rack(app) }
    end
Returns an instance of +Mock5::Api+

 @example
   my_mock_api = Mock5::Api.new("http://example.com") do
     get "posts" do
       [
         {id: 1, body: "a posy body"},
         {id: 2, body: "another post body"}
       ].to_json
     end

     post "posts" do
       halt 201, "The post was created successfully"
     end
   end

 @param endpoint [String, Regexp] a url of the API service to
   endpoint to mock. Can only contain schema and hostname, path
   should be empty.

 @yield a block passed to Sinatra to initialize an app

 @return [Mock5::Api]
 Returns webmock request stub built with Sinatra app and enpoint url

 @return [WebMock::RequestStub]