Class: Transport::Spec::Faker

Inherits:
Object
  • Object
show all
Defined in:
lib/transport/spec/faker.rb

Overview

Spec helper class to fake http and json request.

Defined Under Namespace

Classes: NoFakeRequestError

Constant Summary collapse

TRANSPORT_CLASSES =
[
  Transport::HTTP,
  Transport::JSON
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(fakes) ⇒ Faker

Returns a new instance of Faker.



19
20
21
# File 'lib/transport/spec/faker.rb', line 19

def initialize(fakes)
  @fakes = fakes
end

Instance Method Details

#stub_requests!Object



23
24
25
26
27
# File 'lib/transport/spec/faker.rb', line 23

def stub_requests!
  TRANSPORT_CLASSES.each do |transport_class|
    stub_requests_for_transport! transport_class
  end
end