Sha256: 9d57c8e2a5784a50c8e7a0e0ba0ef7d10fcb46219000fb4a1865d1675aa5e7cd

Contents?: true

Size: 1.25 KB

Versions: 4

Compression:

Stored size: 1.25 KB

Contents

# Spec helper (must include first to track code coverage with SimpleCov)
require File.expand_path('../support/spec_helper', __FILE__)

require "acpc_poker_types/seat"
include AcpcPokerTypes

describe Seat do
  describe '#seats_to' do
    it 'works for basic examples' do
      Seat.new(1, 3).seats_to(0).must_equal 2
      Seat.new(1, 3).seats_to(1).must_equal 0
      Seat.new(1, 3).seats_to(2).must_equal 1
    end
  end
  describe '#seats_from' do
    it 'works for basic examples' do
      Seat.new(1, 3).seats_from(0).must_equal 1
      Seat.new(1, 3).seats_from(1).must_equal 0
      Seat.new(1, 3).seats_from(2).must_equal 2
    end
  end
  describe '#n_seats_away' do
    it 'works for basic examples' do
      Seat.new(1, 3).n_seats_away(0).must_equal 1
      Seat.new(1, 3).n_seats_away(1).must_equal 2
      Seat.new(1, 3).n_seats_away(2).must_equal 0
      Seat.new(1, 3).n_seats_away(3).must_equal 1
      Seat.new(1, 3).n_seats_away(6).must_equal 1
    end
  end
  describe '::in_bounds?' do
    it 'works for basic examples' do
      Seat.in_bounds?(0, 3).must_equal true
      Seat.in_bounds?(1, 3).must_equal true
      Seat.in_bounds?(3, 3).must_equal false
      Seat.in_bounds?(4, 3).must_equal false
      Seat.in_bounds?(-1, 3).must_equal false
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
acpc_poker_types-5.0.2 spec/seat_spec.rb
acpc_poker_types-5.0.1 spec/seat_spec.rb
acpc_poker_types-5.0.0 spec/seat_spec.rb
acpc_poker_types-4.0.0 spec/seat_spec.rb