module MockChargebee

Constants

VERSION

Public Class Methods

environment() click to toggle source
# File lib/mock_chargebee.rb, line 40
def self.environment
  @@environment
end
mock_webhook_payload_for(event_type, event_attributes: {}, content_attributes: {}) click to toggle source
# File lib/mock_chargebee.rb, line 36
def self.mock_webhook_payload_for(event_type, event_attributes: {}, content_attributes: {})
  Webhook.new(event_type, event_attributes, content_attributes).call
end
start() click to toggle source
# File lib/mock_chargebee.rb, line 20
def self.start
  return false if @@state == :started

  @@environment = Environment.new
  @@original_chargebee_request = ChargeBee::Rest.method(:request)
  ChargeBee::Rest.define_singleton_method(:request, &MockChargebee::Request.method(:request))
  @@state = :started
end
stop() click to toggle source
# File lib/mock_chargebee.rb, line 29
def self.stop
  @@environment = nil
  ChargeBee::Rest.define_singleton_method(:request, &@@original_chargebee_request)
  @@original_chargebee_request = nil
  @@state = :ready
end