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

ruby_version_is "1.9" do
  describe "StopIteration#result" do
    it "needs to be reviewed for spec completeness"
  end
end
<commit_msg>Write specs for StopIteration#result<commit_after>require File.expand_path('../../../spec_helper', __FILE__)

describe "StopIteration" do
  it "is a subclass of IndexError" do
    StopIteration.superclass.should equal(IndexError)
  end
end

ruby_version_is "1.9.2" do
  describe "StopIteration#result" do
    before(:each) do
      obj = Object.new
      def obj.each
        yield :yield_returned_1
        yield :yield_returned_2
        :method_returned
      end
      @enum = obj.to_enum
    end

    it "returns the method-returned-object from an Enumerator" do
      @enum.next
      @enum.next
      lambda { @enum.next }.should(
        raise_error(StopIteration) do |error|
          error.result.should equal(:method_returned)
        end
      )
    end
  end
end

{'fraction_non_alphanumeric': 0.0972644376899696, 'fraction_numerical': 0.0070921985815602835, 'mean_word_length': 2.78544061302682, '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': '3818366', 'n_tokens_mistral': 324, 'n_tokens_neox': 313, 'n_words': 82}