<commit_before>require "spec_helper"

describe Rchess::Bishop do
  it "returns its single letter name" do
    lowercase = Rchess::Bishop.new(:lowercase)
    uppercase = Rchess::Bishop.new(:uppercase)

    expect(lowercase.letter).to eq "b"
    expect(uppercase.letter).to eq "B"
  end

  describe "movement on the board" do
    let(:bishop) { Rchess::Bishop.new(:uppercase) }
    let(:starting_point) { "d5" }

    context "identifying intermediate positions" do
        [
          ["g8", ["e6", "f7"], "upper right"],
          ["a8", ["c6", "b7"], "upper left"],
          ["g2", ["e4", "f3"], "lower right"],
          ["a2", ["c4", "b3"], "lower left"]
        ].each do |end_position, intermediate_squares, direction|
        it "returns a list of positions when moving to the #{direction}" do
          expect(
            bishop.intermediate_positions(starting_point, end_position)
          ).to eq intermediate_squares
        end
      end
    end

    context "legal moves" do
      [
        ["f7", "upper right"],
        ["b7", "upper left"],
        ["g2", "lower right"],
        ["b3", "lower left"]
      ].each do |end_position, direction|
        it "can move to the #{direction}" do
          expect(
            bishop.can_move_to_position?(starting_point, end_position)
          ).to eq true
        end
      end

      it "can move one square or multiple squares" do
        one_square = "e6"
        expect(
          bishop.can_move_to_position?(starting_point, one_square)
        ).to eq true

        two_squares = "g8"
        expect(
          bishop.can_move_to_position?(starting_point, two_squares)
        ).to eq true
      end
    end

    context "illegal moves" do
      it "recognizes illegal moves" do
        illegal_move = "a5"
        expect(
          bishop.can_move_to_position?(starting_point, illegal_move)
        ).to eq false
      end
    end
  end
end
<commit_msg>Improve order of block variables for readability<commit_after>require "spec_helper"

describe Rchess::Bishop do
  it "returns its single letter name" do
    lowercase = Rchess::Bishop.new(:lowercase)
    uppercase = Rchess::Bishop.new(:uppercase)

    expect(lowercase.letter).to eq "b"
    expect(uppercase.letter).to eq "B"
  end

  describe "movement on the board" do
    let(:bishop) { Rchess::Bishop.new(:uppercase) }
    let(:starting_point) { "d5" }

    context "identifying intermediate positions" do
        [
          ["upper right", "g8", ["e6", "f7"]],
          ["upper left", "a8", ["c6", "b7"]],
          ["lower right", "g2", ["e4", "f3"]],
          ["lower left", "a2", ["c4", "b3"]]
        ].each do |direction, end_position, intermediate_squares|
        it "returns a list of positions when moving to the #{direction}" do
          expect(
            bishop.intermediate_positions(starting_point, end_position)
          ).to eq intermediate_squares
        end
      end
    end

    context "legal moves" do
      [
        ["f7", "upper right"],
        ["b7", "upper left"],
        ["g2", "lower right"],
        ["b3", "lower left"]
      ].each do |end_position, direction|
        it "can move to the #{direction}" do
          expect(
            bishop.can_move_to_position?(starting_point, end_position)
          ).to eq true
        end
      end

      it "can move one square or multiple squares" do
        one_square = "e6"
        expect(
          bishop.can_move_to_position?(starting_point, one_square)
        ).to eq true

        two_squares = "g8"
        expect(
          bishop.can_move_to_position?(starting_point, two_squares)
        ).to eq true
      end
    end

    context "illegal moves" do
      it "recognizes illegal moves" do
        illegal_move = "a5"
        expect(
          bishop.can_move_to_position?(starting_point, illegal_move)
        ).to eq false
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.11864843951508898, 'fraction_numerical': 0.010317255610007738, 'mean_word_length': 2.239766081871345, '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': '3485729', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1194, 'n_words': 340}