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

ruby_version_is "1.8.7" do
  require File.expand_path('../../../shared/enumerator/rewind', __FILE__)

  describe "Enumerator#rewind" do
    it_behaves_like(:enum_rewind, :rewind)

    ruby_version_is "1.8.8" do
      it "calls the enclosed object's rewind method if one exists" do
        obj = mock('rewinder')
        enum = enumerator_class.new(obj)
        obj.should_receive(:each).at_most(1)
        obj.should_receive(:rewind)
        enum.rewind
      end

      it "does nothing if the object doesn't have a #rewind method" do
        obj = mock('rewinder')
        enum = enumerator_class.new(obj)
        obj.should_receive(:each).at_most(1)
        obj.should_receive(:rewind)
        lambda { enum.rewind.should == enum }.should_not raise_error
      end
    end
  end
end
<commit_msg>Fix the rewind proxying spec<commit_after>require File.expand_path('../../../spec_helper', __FILE__)

ruby_version_is "1.8.7" do
  require File.expand_path('../../../shared/enumerator/rewind', __FILE__)

  describe "Enumerator#rewind" do
    it_behaves_like(:enum_rewind, :rewind)

    ruby_version_is "1.8.8" do
      it "calls the enclosed object's rewind method if one exists" do
        obj = mock('rewinder')
        enum = enumerator_class.new(obj)
        obj.should_receive(:each).at_most(1)
        obj.should_receive(:rewind)
        enum.rewind
      end

      it "does nothing if the object doesn't have a #rewind method" do
        obj = mock('rewinder')
        enum = enumerator_class.new(obj)
        obj.should_receive(:each).at_most(1)
        lambda { enum.rewind.should == enum }.should_not raise_error
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.12057971014492753, 'fraction_numerical': 0.00927536231884058, 'mean_word_length': 2.7440347071583515, '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': '1873336', 'n_tokens_mistral': 584, 'n_tokens_neox': 561, 'n_words': 129}