Sha256: 873c88f86cd71b124ee50888b31e0a34f111fd9aa16741a0209b2a62bba03f3e
Contents?: true
Size: 774 Bytes
Versions: 18
Compression:
Stored size: 774 Bytes
Contents
require 'spec_helper' class TestMiddleware < Acfs::Middleware::Base end describe Acfs::Service::Middleware do let(:srv_class) { Class.new(Acfs::Service) } let(:options) { {} } let(:middleware) { TestMiddleware } describe '.use' do let(:options) { {abc: 'cde'} } it 'should add middleware to list' do srv_class.use middleware expect(srv_class.middleware).to include(middleware) end it 'should add middleware to stack' do srv_class.use middleware expect(srv_class.middleware.build(1)).to be_a(middleware) end it 'should instantiate middleware object' do expect(middleware).to receive(:new).with(anything, options) srv_class.use middleware, options srv_class.middleware.build end end end
Version data entries
18 entries across 18 versions & 1 rubygems