module Trellohub::Mocking

Attributes

called_requests[R]

Public Class Methods

overriding_method(http_method) click to toggle source
# File lib/trellohub/mocking.rb, line 44
      def overriding_method(http_method)
        <<-METHOD
          def #{http_method}_without_http(url, options = {})
            Trellohub::Mocking.print_request(self.class.name, "#{http_method}", url, options)
          end
        METHOD
      end
print_request(klass, method, path, *body) click to toggle source
print_request_summary() click to toggle source
push_called_request(klass, method, path) click to toggle source
# File lib/trellohub/mocking.rb, line 22
def push_called_request(klass, method, path)
  @called_requests = {} if @called_requests.nil?
  @called_requests[klass] = {} if @called_requests[klass].nil?
  @called_requests[klass][method] = [] if @called_requests[klass][method].nil?

  @called_requests[klass][method] << path
end
request_methods() click to toggle source
# File lib/trellohub/mocking.rb, line 18
def request_methods
  %i(post put patch delete)
end
start() click to toggle source
# File lib/trellohub/mocking.rb, line 8
def start
  ::Octokit::Client.__send__ :include, NoRequest
  ::Trell::Client.__send__ :include, NoRequest
end
stop() click to toggle source
# File lib/trellohub/mocking.rb, line 13
def stop
  ::Octokit::Client.__send__ :include, Request
  ::Trell::Client.__send__ :include, Request
end