Module: FFWD::Test::Protocol

Defined in:
lib/ffwd/test/protocol.rb

Instance Method Summary collapse

Instance Method Details

#valid_input(klass, opts = {}) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'lib/ffwd/test/protocol.rb', line 31

def valid_input klass, opts={}
  expect(klass < FFWD::Connection).to be true
  sig = double
  bind = double
  core = double
  config = opts[:config] || double
  expect(klass.respond_to?(:plugin_type)).to be true
  expect(klass.plugin_type.nil?).to be false
  return klass.new sig, bind, core, config
end

#valid_output(klass, opts = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/ffwd/test/protocol.rb', line 21

def valid_output klass, opts={}
  expect(klass < FFWD::Handler).to be true
  sig = double
  connect = double
  config = opts[:config] || double
  expect(klass.respond_to?(:plugin_type)).to be true
  expect(klass.plugin_type.nil?).to be false
  return klass.new sig, connect, config
end