<commit_before>require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

ruby_version_is "1.8.7" do
  describe "Enumerable#cycle" do
    describe "passed no argument or nil" do
      it "loops indefinitely" do
        [[],[nil]].each do |args|
          bomb = 10
          EnumerableSpecs::Numerous.new.cycle(*args) do
            bomb -= 1
            break 42 if bomb <= 0
          end.should == 42
          bomb.should == 0
        end
      end

      it "returns if there are no elements" do
        out = EnumerableSpecs::Empty.new.cycle { break :nope }
        out.should be_nil
      end

      it "yields successive elements of the array repeatedly" do
        b = []
        EnumerableSpecs::Numerous.new(1,2,3).cycle do |elem|<commit_msg>Fix a description typo for Enumerable#cycle spec<commit_after>require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

ruby_version_is "1.8.7" do
  describe "Enumerable#cycle" do
    describe "passed no argument or nil" do
      it "loops indefinitely" do
        [[],[nil]].each do |args|
          bomb = 10
          EnumerableSpecs::Numerous.new.cycle(*args) do
            bomb -= 1
            break 42 if bomb <= 0
          end.should == 42
          bomb.should == 0
        end
      end

      it "returns nil if there are no elements" do
        out = EnumerableSpecs::Empty.new.cycle { break :nope }
        out.should be_nil
      end

      it "yields successive elements of the array repeatedly" do
        b = []
        EnumerableSpecs::Numerous.new(1,2,3).cycle do |elem|
{'fraction_non_alphanumeric': 0.11244738424533975, 'fraction_numerical': 0.01803968731208659, 'mean_word_length': 2.1634980988593155, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3419076', 'n_tokens_mistral': 533, 'n_tokens_neox': 486, 'n_words': 148}