<commit_before>require_relative 'player'
require_relative 'treasure_trove'

describe Player do
  let(:initial_health) { 150 }

  before do
    $stdout = StringIO.new      #supress (redirect) the standard output
    @player = Player.new "larry", initial_health
  end

  it "has a capitalized name" do
    expect(@player.name).to eq "Larry"
  end

  it "has an initial health" do
    expect(@player.health).to eq initial_health
  end

  it "has a string representation" do
    @player.found_treasure Treasure.new(:hammer, 50)
    @player.found_treasure Treasure.new(:hammer, 50)

    expect(@player.to_s).to eq "I'm Larry with health = 150, points = 100 and score = 250."
  end

  it "computes a score as the sum o its health and points" do
    @player.found_treasure Treasure.new(:hammer, 50)
    @player.found_treasure Treasure.new(:hammer, 50)

    expect(@player.score).to eq initial_health + 50 + 50
  end

  context "when w00ted" do
    before { @player.w00t }

    it "increases health" do<commit_msg>Fix typo<commit_after>require_relative 'player'
require_relative 'treasure_trove'

describe Player do
  let(:initial_health) { 150 }

  before do
    $stdout = StringIO.new      #supress (redirect) the standard output
    @player = Player.new "larry", initial_health
  end

  it "has a capitalized name" do
    expect(@player.name).to eq "Larry"
  end

  it "has an initial health" do
    expect(@player.health).to eq initial_health
  end

  it "has a string representation" do
    @player.found_treasure Treasure.new(:hammer, 50)
    @player.found_treasure Treasure.new(:hammer, 50)

    expect(@player.to_s).to eq "I'm Larry with health = 150, points = 100 and score = 250."
  end

  it "computes a score as the sum of its health and points" do
    @player.found_treasure Treasure.new(:hammer, 50)
    @player.found_treasure Treasure.new(:hammer, 50)

    expect(@player.score).to eq initial_health + 50 + 50
  end

  context "when w00ted" do
    before { @player.w00t }

    it "increases health" do
{'fraction_non_alphanumeric': 0.099601593625498, 'fraction_numerical': 0.027888446215139442, 'mean_word_length': 3.5452488687782804, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2587867', 'n_tokens_mistral': 725, 'n_tokens_neox': 630, 'n_words': 206}