Sha256: d86ecae6342a19dd7cc4a4ec84ea0dcf61fa7bfe3ca817df768389f36f931c49

Contents?: true

Size: 574 Bytes

Versions: 8

Compression:

Stored size: 574 Bytes

Contents

require 'spec_helper'

unless RUBY_PLATFORM == 'opal'
  describe Volt::MiddlewareStack do
    before do
      @stack = Volt::MiddlewareStack.new
    end

    it 'should set_app' do
      app = double('rack app')
      @stack.set_app(app)
      expect(@stack.instance_variable_get('@app')).to eq(app)
    end

    it 'should insert a middleware at the end of the stack when calling use' do
      middleware1 = double('middleware1')
      @stack.use(middleware1, 'arg1')

      expect(@stack.middlewares).to eq([
        [[middleware1, 'arg1'], nil]
      ])
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
volt-0.9.4.pre5 spec/server/middleware/middleware_handler.rb
volt-0.9.4.pre3 spec/server/middleware/middleware_handler.rb
volt-0.9.4.pre2 spec/server/middleware/middleware_handler.rb
volt-0.9.4.pre1 spec/server/middleware/middleware_handler.rb
volt-0.9.3 spec/server/middleware/middleware_handler.rb
volt-0.9.3.pre6 spec/server/middleware/middleware_handler.rb
volt-0.9.3.pre5 spec/server/middleware/middleware_handler.rb
volt-0.9.3.pre4 spec/server/middleware/middleware_handler.rb