Revision: 1270 http://trac.macosforge.org/projects/ruby/changeset/1270 Author: eloy.de.enige@gmail.com Date: 2009-03-30 13:42:44 -0700 (Mon, 30 Mar 2009) Log Message: ----------- Fixed readchar example for 1.8/1.9. Modified Paths: -------------- MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb Modified: MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb =================================================================== --- MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb 2009-03-30 18:48:58 UTC (rev 1269) +++ MacRuby/branches/experimental/spec/frozen/core/io/readchar_spec.rb 2009-03-30 20:42:44 UTC (rev 1270) @@ -11,15 +11,28 @@ @file.close unless @file.closed? end - it "returns the next byte from the stream" do - @file.readchar.should == 'V' - @file.readchar.should == 'o' - @file.readchar.should == 'i' - # read the rest of line - @file.readline.should == "ci la ligne une.\n" - @file.readchar.should == 'Q' + ruby_version_is "" ... "1.9" do + it "returns the next byte from the stream" do + @file.readchar.should == 86 + @file.readchar.should == 111 + @file.readchar.should == 105 + # read the rest of line + @file.readline.should == "ci la ligne une.\n" + @file.readchar.should == 81 + end end + ruby_version_is "1.9" do + it "returns the next character from the stream" do + @file.readchar.should == 'V' + @file.readchar.should == 'o' + @file.readchar.should == 'i' + # read the rest of line + @file.readline.should == "ci la ligne une.\n" + @file.readchar.should == 'Q' + end + end + it "raises EOFError when invoked at the end of the stream" do # read entire content @file.read