module Gruf::Rspec::Helpers

Module for including rspec helpers

Public Instance Methods

grpc_active_call(options = {}) click to toggle source

@param [Hash] options @return [Double] The mocked call

# File lib/gruf/rspec/helpers.rb, line 30
def grpc_active_call(options = {})
  md = _build_active_call_metadata(options)
  double(:grpc_active_call, metadata: md, output_metadata: options.fetch(:output_metadata, {}))
end

Private Instance Methods

_build_active_call_metadata(options) click to toggle source

@param [Hash] options

# File lib/gruf/rspec/helpers.rb, line 40
def _build_active_call_metadata(options)
  Gruf::Rspec::MetadataFactory.new(options).build(options.fetch(:metadata, {}))
end