<commit_before><?php

namespace spec;

use Game;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class GameSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('Game');
    }
    /**
     * can roll
     */
    function it_can_roll()
    {
        $this->roll(0);
    }

    /**
     * can roll gutter game
     */
    function it_can_roll_gutter_game()
    {
        $this->rollMany(20, 0);
        $this->score()->shouldReturn(0);
    }

    /**
     * can roll all ones
     */
    function it_can_roll_all_ones()
    {
        $this->rollMany(20, 1);
        $this->score()->shouldReturn(20);
    }

    /**
     * can roll spare
     */
    function it_can_roll_one_spare()
    {
        $this->rollSpare();
        $this->roll(3);
        $this->rollMany(17, 0);
        $this->score()->shouldReturn(16);
    }

    /**
     * can roll strike
     */
    function it_can_roll_strike()
    {
        $this->roll(10);
        $this->roll(3);
        $this->roll(4);
        $this->rollMany(16, 0);
        $this->score()->shouldReturn(24);
    }

    /**
     * @param $n
     * @param $pins
     */
    public function rollMany($n, $pins)
    {
        for ($i = 0; $i < $n; $i++) {
            $this->roll($pins);
        }
    }

    public function rollSpare()
    {
        $this->roll(5);
        $this->roll(5);
    }
}<commit_msg>add a rollStrike method to test<commit_after><?php

namespace spec;

use Game;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class GameSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('Game');
    }
    /**
     * can roll
     */
    function it_can_roll()
    {
        $this->roll(0);
    }

    /**
     * can roll gutter game
     */
    function it_can_roll_gutter_game()
    {
        $this->rollMany(20, 0);
        $this->score()->shouldReturn(0);
    }

    /**
     * can roll all ones
     */
    function it_can_roll_all_ones()
    {
        $this->rollMany(20, 1);
        $this->score()->shouldReturn(20);
    }

    /**
     * can roll spare
     */
    function it_can_roll_one_spare()
    {
        $this->rollSpare();
        $this->roll(3);
        $this->rollMany(17, 0);
        $this->score()->shouldReturn(16);
    }

    /**
     * can roll strike
     */
    function it_can_roll_strike()
    {
        $this->rollStrike();
        $this->roll(3);
        $this->roll(4);
        $this->rollMany(16, 0);
        $this->score()->shouldReturn(24);
    }

    /**
     * @param $n
     * @param $pins
     */
    public function rollMany($n, $pins)
    {
        for ($i = 0; $i < $n; $i++) {
            $this->roll($pins);
        }
    }

    public function rollSpare()
    {
        $this->roll(5);
        $this->roll(5);
    }

    public function rollStrike()
    {
        $this->roll(10);
    }
}
{'fraction_non_alphanumeric': 0.16591461298160362, 'fraction_numerical': 0.0194376952447067, 'mean_word_length': 1.7137476459510357, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 48, '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': '4356337', 'n_tokens_mistral': 1034, 'n_tokens_neox': 989, 'n_words': 169}