Sha256: 9424db1491454912d03b11d6a04a499ae77257a7ba1fa1bc9e985db440f4b6c8

Contents?: true

Size: 629 Bytes

Versions: 3

Compression:

Stored size: 629 Bytes

Contents

require 'cucumber/rspec/doubles'

# Set up the mocks. Ookla would approve.
Ey::Core::Client.mock!
Ey::Core::Client::Mock.timeout = 0.1
Ey::Core::Client::Mock.poll_interval = 0
Ey::Core::Client::Real.timeout = 3
Ey::Core::Client::Real.poll_interval = 0

Before do
  # Reset the mocked API before every scenario
  Ey::Core::Client::Mock.reset!

  # Stub out `#core_client` on all subcommands to ensure that they're using
  # the mocked client. Otherwise, everything turns to calamity, because the
  # mocked API is silly.
  allow_any_instance_of(Ey::Core::Cli::Subcommand).
    to receive(:core_client).
    and_return(client)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ey-core-3.6.4 features/support/mock_api.rb
ey-core-3.6.3 features/support/mock_api.rb
ey-core-3.6.1 features/support/mock_api.rb