<commit_before>require 'spec_helper'

module Vim
  module Flavor
    describe EnumerableExtension do
    end
  end
end
<commit_msg>Add a spec for EnumerableExtension#before_each<commit_after>require 'spec_helper'

module Vim
  module Flavor
    describe EnumerableExtension do
      describe '#before_each' do
        it 'runs a given block before enumerating each element' do
          xs = []
          [1, 2, 3].
          before_each {|n| xs << "before_each #{n}"}.
          each do |n|
            xs << "each #{n}"
          end

          xs.should == [
            "before_each 1",
            "each 1",
            "before_each 2",
            "each 2",
            "before_each 3",
            "each 3",
          ]
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08865710560625815, 'fraction_numerical': 0.011734028683181226, 'mean_word_length': 1.63013698630137, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2341794', 'n_tokens_mistral': 242, 'n_tokens_neox': 225, 'n_words': 72}