Fixed discrepancy between results for obj.methods in 1.8 v. 1.9
[ruby_koans.git] / koans / about_iteration.rb
index b48c278..823128f 100644 (file)
@@ -1,9 +1,16 @@
 require File.expand_path(File.dirname(__FILE__) + '/edgecase')
 
 class AboutIteration < EdgeCase::Koan
+  in_ruby_version("1.8") do
+    def test_each_is_a_method_on_arrays
+      assert_equal __, [].methods.include?("each")
+    end
+  end
 
-  def test_each_is_a_method_on_arrays
-    assert_equal __, [].methods.include?(:each)
+  in_ruby_version("1.9") do
+    def test_each_is_a_method_on_arrays
+      assert_equal __, [].methods.include?(:each)
+    end
   end
 
   def test_iterating_with_each