Sha256: 29912339e99a37c24c423b5bc4acddb828952d4af9aa5effc2222a0b702e9307

Contents?: true

Size: 822 Bytes

Versions: 1

Compression:

Stored size: 822 Bytes

Contents

require 'tarzan/games/rock_paper_scissors/move'

module Tarzan
  module Games
    module RockPaperScissors
      describe Move do
        describe '<=>' do
          context 'given a hand of Rock' do
            let (:move_p1) { Move.new hand: 'R' }

            context 'versus a hand of Scissors' do
              let (:move_p2) { Move.new hand: 'S'}
              it { expect(move_p1 <=> move_p2).to eq 1}
            end

            context 'versus a hand of Paper' do
              let (:move_p2) { Move.new hand: 'P'}
              it { expect(move_p1 <=> move_p2).to eq -1}
            end

            context 'versus a hand of Rock' do
              let (:move_p2) { Move.new hand: 'R'}
              it { expect(move_p1 <=> move_p2).to eq 0}
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tarzan-0.0.3 spec/tarzan/games/rock_paper_scissors/move_spec.rb