module Quovo::Fake

Public Instance Methods

fake!(fake_calls = []) click to toggle source

format of fake calls [

[:get, "/accounts/id", {}, { id: 123, nickname: '123' ... }]

]

# File lib/quovo/fake.rb, line 11
def fake!(fake_calls = [])
  @fake_calls = fake_calls
  @fake = true
  Quovo.config.token_storage = Object.new.tap do |o|
    def o.read(_)
      ['FAKE-TOKEN', (Time.now.utc + 1_000).iso8601].join('|')
    end
  end
end
fake?() click to toggle source
# File lib/quovo/fake.rb, line 3
def fake?
  @fake
end
fake_calls() click to toggle source
# File lib/quovo/fake.rb, line 25
def fake_calls
  @fake_calls
end
real!() click to toggle source
# File lib/quovo/fake.rb, line 21
def real!
  @fake = false
end