Sha256: 3e19cb542cd1f7188a430606ba8db6fcff71f4f4fb180918eef4d30b7b14187e

Contents?: true

Size: 675 Bytes

Versions: 25

Compression:

Stored size: 675 Bytes

Contents

# -*- coding: utf-8 -*-
# frozen_string_literal: true
require_relative 'test_helper'

module Dynflow
  module RoundRobinTest
    describe RoundRobin do
      let(:rr) { Dynflow::RoundRobin.new }
      specify do
        assert_nil rr.next
        assert_nil rr.next
        _(rr).must_be_empty
        rr.add 1
        _(rr.next).must_equal 1
        _(rr.next).must_equal 1
        rr.add 2
        _(rr.next).must_equal 2
        _(rr.next).must_equal 1
        _(rr.next).must_equal 2
        rr.delete 1
        _(rr.next).must_equal 2
        _(rr.next).must_equal 2
        rr.delete 2
        assert_nil rr.next
        _(rr).must_be_empty
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
dynflow-1.8.2 test/round_robin_test.rb
dynflow-1.8.1 test/round_robin_test.rb
dynflow-1.8.0 test/round_robin_test.rb
dynflow-1.7.0 test/round_robin_test.rb
dynflow-1.6.11 test/round_robin_test.rb
dynflow-1.6.10 test/round_robin_test.rb
dynflow-1.6.8 test/round_robin_test.rb
dynflow-1.6.7 test/round_robin_test.rb
dynflow-1.6.6 test/round_robin_test.rb
dynflow-1.6.5 test/round_robin_test.rb
dynflow-1.6.4 test/round_robin_test.rb
dynflow-1.6.3 test/round_robin_test.rb
dynflow-1.6.2 test/round_robin_test.rb
dynflow-1.6.1 test/round_robin_test.rb
dynflow-1.4.9 test/round_robin_test.rb
dynflow-1.4.8 test/round_robin_test.rb
dynflow-1.5.0 test/round_robin_test.rb
dynflow-1.4.7 test/round_robin_test.rb
dynflow-1.4.6 test/round_robin_test.rb
dynflow-1.4.5 test/round_robin_test.rb