<commit_before>require 'test_helper'

class DeckTest < MiniTest::Unit::TestCase
  def setup
    @deck = Deck.new
  end

  def test_builds_a_deck
    refute_empty @deck.cards
  end

  def test_shuffle!
    refute_equal @deck.cards.clone, @deck.shuffle!
  end

  def test_cut!
    assert_change(lambda { @deck.cards.first }) { @deck.shuffle!.cut! }
  end

  def test_deal_returns_one_card
    card = @deck.deal!

    assert_instance_of Card, card
  end

  def test_deal_removes_one_card
    @deck.deal!
    assert_equal 51, @deck.card_count
  end
end<commit_msg>Fixes a bug in the test cutting the deck after shuffling had a 1/14 chance of failing, because 2 cards of the same rank are considered 'equal' when what we really want to test for is 'same'ness<commit_after>require 'test_helper'

class DeckTest < MiniTest::Unit::TestCase
  def setup
    @deck = Deck.new
  end

  def test_builds_a_deck
    refute_empty @deck.cards
  end

  def test_shuffle!
    refute_equal @deck.cards.clone, @deck.shuffle!
  end

  def test_cut_splits_a_deck_in_half
    assert_same @deck.cards.first, @deck.cut!.cards[@deck.card_count/2]
  end

  def test_deal_returns_one_card
    card = @deck.deal!

    assert_instance_of Card, card
  end

  def test_deal_removes_one_card
    @deck.deal!
    assert_equal 51, @deck.card_count
  end
end
{'fraction_non_alphanumeric': 0.07721423164269493, 'fraction_numerical': 0.006813020439061317, 'mean_word_length': 3.6549295774647885, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4507988', 'n_tokens_mistral': 497, 'n_tokens_neox': 466, 'n_words': 121}