<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -27,13 +27,18 @@ ruby_version_is &quot;1.9&quot; do
       @enum.with_index(1) {|e,i| acc &lt;&lt; [e,i] }
       acc.should == [[1,1],[2,2],[3,3],[4,4]]
     end
-    
-    it &quot;raises a TypeError when a non numeric argument is given&quot; do
+
+    it &quot;raises a TypeError when the argument cannot be converted to numeric&quot; do
       lambda do
-        @enum.with_index('1') {|o, i| i}
+        @enum.with_index('1') {|i| i}
       end.should raise_error(TypeError)
     end
-    
+
+    it &quot;converts non-numeric arguments to Integer via #to_int&quot; do
+      (o = mock('1')).should_receive(:to_int).and_return(1)
+      @enum.with_index(o).to_a.should == [[1,1],[2,2],[3,3],[4,4]]
+    end
+
     it &quot;coerces the given numeric argument to an Integer&quot; do
       @enum.with_index(1.678).to_a.should == [[1,1],[2,2],[3,3],[4,4]]
     end</diff>
      <filename>core/enumerator/with_index_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>86154c2318c5ea586814aaab1d3235ddefb81dba</id>
    </parent>
  </parents>
  <author>
    <name>Vladimir Sizikov</name>
    <email>vsizikov@gmail.com</email>
  </author>
  <url>http://github.com/rubyspec/rubyspec/commit/1c48eb3aab34adf3bbd2e207be33c141e2ea8fc7</url>
  <id>1c48eb3aab34adf3bbd2e207be33c141e2ea8fc7</id>
  <committed-date>2009-11-08T13:19:54-08:00</committed-date>
  <authored-date>2009-11-08T13:19:54-08:00</authored-date>
  <message>New enumerator spec.</message>
  <tree>70c5bb51b0678a7c5355d15e9a85db421cff4592</tree>
  <committer>
    <name>Vladimir Sizikov</name>
    <email>vsizikov@gmail.com</email>
  </committer>
</commit>
