require 'spec_helper'

describe Poker do

	# it { expect(Poker::PokerGroup.new("W-3 X-3 Y-3 Z-8 X-4",'xiaozhao').compare(Poker::PokerGroup.new("W-2 X-3 Y-4 Z-8",'xiaohu'))).to eq('xiaozhao win !') }
	# it { expect(Poker::PokerGroup.new("W-3 X-3 Y-3 Z-8 X-4",'xiaozhao').compare(Poker::PokerGroup.new("W-2 X-2 Y-2 Z-8 X-2",'xiaohu'))).to eq('xiaohu win !') }
	it { expect(Poker.test(["W-3 X-J Y-2 Z-8 X-4",'xiaozhao'], ["W-3 X-2 Y-5 Z-J X-4",'xiaohu'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-3 X-J Y-2 Z-5 X-4",'xiaozhao'], ["W-3 X-2 Y-6 Z-J X-4",'xiaohu'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-3 X-J Y-2 Z-8 X-4",'xiaohu'], ["W-3 X-2 Y-8 Z-J X-5",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-3 X-Q Y-2 Z-8 X-4",'xiaozhao'], ["W-3 X-7 Y-5 Z-J X-4",'xiaohu'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-4 X-3 Y-4 Z-J X-4",'xiaohu'], ["W-3 X-2 Y-8 Z-7 X-4",'xiaozhao'])).to eq("xiaohu win !")}


	it { expect(Poker.test(["W-3 X-J Y-3 Z-8 X-4",'xiaohu'], ["W-7 X-7 Y-5 Z-J X-4",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-3 X-J Y-3 Z-8 X-4",'xiaohu'], ["W-3 X-3 Y-5 Z-J X-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-3 X-J Y-3 Z-8 X-4",'xiaohu'], ["W-7 X-5 Y-5 Z-J X-4",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-3 X-J Y-8 Z-8 X-4",'xiaohu'], ["W-3 X-3 Y-5 Z-J X-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-3 X-J Y-4 Z-8 X-4",'xiaohu'], ["W-7 X-7 Y-5 Z-J X-4",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-8 X-J Y-3 Z-8 X-4",'xiaohu'], ["W-4 X-3 Y-5 Z-J X-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-4 X-3 Y-4 Z-J X-4",'xiaohu'], ["W-3 X-4 Y-8 Z-7 X-4",'xiaozhao'])).to eq("xiaohu win !")}

	it { expect(Poker.test(["W-4 X-J Y-8 Z-8 X-4",'xiaohu'], ["W-3 X-3 Y-4 Z-J X-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-J X-J Y-4 Z-8 X-4",'xiaohu'], ["W-7 X-7 Y-5 Z-J X-J",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-Q X-3 Y-8 Z-8 X-3",'xiaohu'], ["W-3 X-3 Y-5 Z-J X-J",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-J X-J Y-4 Z-8 X-4",'xiaohu'], ["W-4 X-4 Y-5 Z-J X-J",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-4 X-3 Y-4 Z-J X-4",'xiaohu'], ["W-8 X-4 Y-8 Z-7 X-4",'xiaozhao'])).to eq("xiaohu win !")}


	it { expect(Poker.test(["W-4 X-J Y-4 Z-J X-4",'xiaohu'], ["W-3 X-3 Y-3 Z-4 X-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-4 X-3 Y-4 Z-J X-4",'xiaohu'], ["W-3 X-3 Y-3 Z-4 X-4",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-4 X-3 Y-4 Z-J X-4",'xiaohu'], ["W-8 X-2 Y-8 Z-7 X-4",'xiaozhao'])).to eq("xiaohu win !")}
	
	it { expect(Poker.test(["W-4 X-4 Y-4 Z-J X-4",'xiaohu'], ["W-3 X-3 Y-3 Z-3 X-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-4 X-3 Y-4 Z-J X-4",'xiaohu'], ["W-3 X-3 Y-3 Z-3 X-4",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-4 X-4 Y-4 Z-J X-4",'xiaohu'], ["W-3 X-2 Y-8 Z-7 X-4",'xiaozhao'])).to eq("xiaohu win !")}

	it { expect(Poker.test(["W-3 X-4 Y-5 Z-6 X-7",'xiaohu'], ["W-4 X-5 Y-8 Z-7 X-6",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-10 X-J Y-Q Z-K X-A",'xiaohu'], ["W-3 X-2 Y-8 Z-7 X-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-5 X-3 Y-4 Z-2 X-A",'xiaohu'], ["W-3 X-2 Y-8 Z-7 X-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-4 X-5 Y-6 Z-7 X-8",'xiaohu'], ["W-9 X-10 Y-J Z-Q X-K",'xiaozhao'])).to eq("xiaozhao win !")}

	it { expect(Poker.test(["W-3 X-J Y-4 Z-8 X-4",'xiaohu'], ["W-7 X-7 Y-5 Z-J X-4",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-8 X-J Y-3 Z-8 X-4",'xiaohu'], ["W-4 X-3 Y-5 Z-J X-4",'xiaozhao'])).to eq("xiaohu win !")}
	####flush and flush staight
	it { expect(Poker.test(["W-3 X-J Y-4 Z-J X-4",'xiaohu'], ["W-7 W-8 W-5 W-J W-4",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-K X-4 Y-5 Z-8 X-7",'xiaohu'], ["W-7 W-8 W-5 W-J W-4",'xiaozhao'])).to eq("xiaozhao win !")}

	it { expect(Poker.test(["W-3 X-A Y-4 Z-2 X-5",'xiaohu'], ["W-7 X-7 W-5 W-J W-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-3 X-6 Y-4 Z-2 X-5",'xiaohu'], ["W-7 X-7 X-5 W-J W-4",'xiaozhao'])).to eq("xiaohu win !")}
	it { expect(Poker.test(["W-3 X-2 Y-4 Z-5 X-6",'xiaohu'], ["W-3 X-A Y-4 Z-2 X-5",'xiaozhao'])).to eq("xiaohu win !")}

	it { expect(Poker.test(["W-J X-J Y-4 Z-J X-J",'xiaohu'], ["W-7 W-8 W-5 W-6 W-4",'xiaozhao'])).to eq("xiaozhao win !")}
	it { expect(Poker.test(["W-A W-2 W-3 W-4 W-5",'xiaohu'], ["W-7 W-8 W-5 X-6 W-4",'xiaozhao'])).to eq("xiaohu win !")}



end