Revision
1280
Author
eloy.de.enige@gmail.com
Date
2009-03-31 02:55:27 -0700 (Tue, 31 Mar 2009)

Log Message

Fixed the IO#getc spec to work on 1.8 _and_ 1.9.

Modified Paths

Diff

Modified: MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb (1279 => 1280)


--- MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb	2009-03-31 09:45:07 UTC (rev 1279)
+++ MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb	2009-03-31 09:55:27 UTC (rev 1280)
@@ -11,15 +11,28 @@
     @file.close unless @file.closed?
   end
 
-  it "returns the next byte from the stream" do
-    @file.getc.should == 'V'
-    @file.getc.should == 'o'
-    @file.getc.should == 'i'
-    # read the rest of line
-    @file.readline.should == "ci la ligne une.\n"
-    @file.getc.should == 'Q'
+  ruby_version_is "" ... "1.9" do
+    it "returns the next byte from the stream" do
+      @file.getc.should == 86
+      @file.getc.should == 111
+      @file.getc.should == 105
+      # read the rest of line
+      @file.readline.should == "ci la ligne une.\n"
+      @file.getc.should == 81
+    end
   end
 
+  ruby_version_is "1.9" do
+    it "returns the next character from the stream" do
+      @file.getc.should == 'V'
+      @file.getc.should == 'o'
+      @file.getc.should == 'i'
+      # read the rest of line
+      @file.readline.should == "ci la ligne une.\n"
+      @file.getc.should == 'Q'
+    end
+  end
+
   it "returns nil when invoked at the end of the stream" do
     # read entire content
     @file.read