Sha256: d64f2f075aade905d2b38d2fc83b5447977e7074b08fb22c6b5d347c6094b18a
Contents?: true
Size: 1.63 KB
Versions: 1
Compression:
Stored size: 1.63 KB
Contents
require "helper" describe Bridge::Trick do it "the highest H card is the winner in NT game H trick and single suit" do trick = Bridge::Trick.new("H2", "H3", "H4", "H5") assert_equal Bridge::Card.new("H5"), trick.winner end it "the highest H card is the winner in NT game H trick and multiple suits" do trick = Bridge::Trick.new("H2", "C3", "D4", "S5") assert_equal Bridge::Card.new("H2"), trick.winner end it "the highest H card is the winner in S game H trick and single suit" do trick = Bridge::Trick.new("H2", "H5", "H4", "H3") assert_equal Bridge::Card.new("H5"), trick.winner("S") end it "the highest H card is the winner in S game H trick and multiple suits" do trick = Bridge::Trick.new("H2", "D5", "C4", "H3") assert_equal Bridge::Card.new("H3"), trick.winner("S") end it "the only trump is the winner in S game H trick and multiple suits" do trick = Bridge::Trick.new("H2", "D5", "S2", "H3") assert_equal Bridge::Card.new("S2"), trick.winner("S") end it "the highest trump is the winner in S game H trick and multiple suits" do trick = Bridge::Trick.new("H2", "SA", "S2", "H3") assert_equal Bridge::Card.new("SA"), trick.winner("S") end it "the highest trump is the winner in S game S trick and multiple suits" do trick = Bridge::Trick.new("S2", "HA", "CA", "DA") assert_equal Bridge::Card.new("S2"), trick.winner("S") end it "is incomplete with 3 cards" do trick = Bridge::Trick.new("S2", "HA", "CA") assert trick.incomplete? end it "is incomplete with 4 cards" do trick = Bridge::Trick.new("S2", "HA", "CA", "DA") assert trick.complete? end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bridge-0.2.0 | test/trick_test.rb |