[macruby-changes] [1280] MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb
source_changes at macosforge.org
source_changes at macosforge.org
Tue Mar 31 02:55:27 PDT 2009
Revision: 1280
http://trac.macosforge.org/projects/ruby/changeset/1280
Author: eloy.de.enige at 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:
--------------
MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb
Modified: MacRuby/branches/experimental/spec/frozen/core/io/getc_spec.rb
===================================================================
--- 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090331/9bbdc9e2/attachment-0001.html>
More information about the macruby-changes
mailing list