Sha256: 701c2d5622b0c88ef50f76740958aca37bf74af0a228ed48499400e2afcecd5c

Contents?: true

Size: 860 Bytes

Versions: 3

Compression:

Stored size: 860 Bytes

Contents

require_relative '../spec_helper'

feature 'process pool can keep limited number of processes running between test evicting processes using LRU', subject: :process do
	scenario 'extra LRU processes (over 4 by default) are stopped between tests' do
		instances = []
		instances << subject.with{|p| p.argument '1'}.start
		instances << subject.with{|p| p.argument '2'}.start
		instances << subject.with{|p| p.argument '3'}.start
		instances << subject.with{|p| p.argument '4'}.start
		instances << subject.with{|p| p.argument '5'}.start

		# keeps all running
		expect(instances).to all be_running

		# let LRU do the job (executed after each scenario/example)
		process_pool.cleanup

		# first instance should not be running (LRU)
		expect(instances.shift).not_to be_running
		# remaining 4 should be kept running
		expect(instances).to all be_running
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-background-process-0.1.2 spec/features/pool_lru_spec.rb
rspec-background-process-0.1.1 spec/features/pool_lru_spec.rb
rspec-background-process-0.1.0 spec/features/pool_lru_spec.rb