[macruby-changes] [1713] MacRuby/branches/experimental
source_changes at macosforge.org
source_changes at macosforge.org
Wed Jun 3 15:24:14 PDT 2009
Revision: 1713
http://trac.macosforge.org/projects/ruby/changeset/1713
Author: eloy.de.enige at gmail.com
Date: 2009-06-03 15:24:14 -0700 (Wed, 03 Jun 2009)
Log Message:
-----------
Tagged critical and failing examples of IO spec and added IO to spec:ci. Had to disable a few specs, some contain syntax errors. There's still a few lines of output regarding IO spewed out after the suite has ran: `cat: stdin: Input/output error'.
Modified Paths:
--------------
MacRuby/branches/experimental/rakelib/spec.rake
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_byte_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/getc_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/kernel/open_tags.txt
Added Paths:
-----------
MacRuby/branches/experimental/spec/frozen/core/io/dup_spec_disabled.rb
MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec_disabled.rb
MacRuby/branches/experimental/spec/frozen/core/io/lines_spec_disabled.rb
MacRuby/branches/experimental/spec/frozen/core/io/printf_spec_disabled.rb
MacRuby/branches/experimental/spec/frozen/core/io/puts_spec_disabled.rb
MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec_disabled.rb
MacRuby/branches/experimental/spec/frozen/core/io/seek_spec_disabled.rb
MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec_disabled.rb
MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec_disabled.rb
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/bytes_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/chars_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/close_read_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/close_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/data/
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/data/data_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/data/flock_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_char_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_line_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/eof_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/for_fd_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/foreach_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/gets_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/isatty_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/lineno_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/new_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/open_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/output_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/popen_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/print_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/read_nonblock_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/read_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readlines_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readpartial_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/reopen_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/select_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/stat_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/sysread_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/to_io_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/tty_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/ungetc_tags.txt
Removed Paths:
-------------
MacRuby/branches/experimental/spec/frozen/core/io/dup_spec.rb
MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec.rb
MacRuby/branches/experimental/spec/frozen/core/io/lines_spec.rb
MacRuby/branches/experimental/spec/frozen/core/io/printf_spec.rb
MacRuby/branches/experimental/spec/frozen/core/io/puts_spec.rb
MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec.rb
MacRuby/branches/experimental/spec/frozen/core/io/seek_spec.rb
MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec.rb
MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec.rb
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/initialize_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readchar_tags.txt
MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/syswrite_tags.txt
Modified: MacRuby/branches/experimental/rakelib/spec.rake
===================================================================
--- MacRuby/branches/experimental/rakelib/spec.rake 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/rakelib/spec.rake 2009-06-03 22:24:14 UTC (rev 1713)
@@ -67,6 +67,7 @@
spec/frozen/core/filetest
spec/frozen/core/hash
spec/frozen/core/integer
+ spec/frozen/core/io
spec/frozen/core/kernel
spec/frozen/core/matchdata
spec/frozen/core/math
@@ -102,12 +103,12 @@
desc "Run continuous integration language examples (all known good examples)"
task :ci do
- sh "./mspec/bin/mspec ci -I./lib -B #{MACRUBY_MSPEC} spec/macruby #{CI_DIRS} #{KNOWN_GOOD_CORE_IO_FILES.join(' ')}"
+ sh "./mspec/bin/mspec ci -I./lib -B #{MACRUBY_MSPEC} spec/macruby #{CI_DIRS}"
end
desc "Run continuous integration language examples (all known good examples) (32 bit mode)"
task :ci32 do
- sh "/usr/bin/arch -arch i386 ./miniruby ./mspec/bin/mspec-ci -I./lib -B #{MACRUBY_MSPEC} #{CI_DIRS} #{KNOWN_GOOD_CORE_IO_FILES.join(' ')}"
+ sh "/usr/bin/arch -arch i386 ./miniruby ./mspec/bin/mspec-ci -I./lib -B #{MACRUBY_MSPEC} #{CI_DIRS}"
end
desc "Run IO test with GDB enabled"
Deleted: MacRuby/branches/experimental/spec/frozen/core/io/dup_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/dup_spec.rb 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/core/io/dup_spec.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,75 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-
-describe "IO#dup" do
- before :all do
- @file = tmp("rubinius_spec_io_dup_#{$$}_#{Time.now.to_f}")
- end
-
- before :each do
- @f = File.open @file, 'w+'
- @i = @f.dup
-
- @f.sync = true
- @i.sync = true
- end
-
- after :each do
- @i.close unless @i.closed?
- @f.close unless @f.closed?
- end
-
- after :all do
- File.unlink @file if File.exists?(@file)
- end
-
- it "returns a new IO instance" do
- @i.class.should == @f.class
- end
-
- it "sets a new descriptor on the returned object" do
- @i.fileno.should_not == @f.fileno
- end
-
-quarantine! do # This does not appear to be consistent across platforms
- it "shares the original stream between the two IOs" do
- start = @f.pos
- @i.pos.should == start
-
- s = "Hello, wo.. wait, where am I?\n"
- s2 = "<evil voice> Muhahahaa!"
-
- @f.write s
- @i.pos.should == @f.pos
-
- @i.rewind
- @i.gets.should == s
-
- @i.rewind
- @i.write s2
-
- @f.rewind
- @f.gets.should == "#{s2}\n"
- end
-end
-
- it "allows closing the new IO without affecting the original" do
- @i.close
- lambda { @f.gets }.should_not raise_error(Exception)
-
- @i.closed?.should == true
- @f.closed?.should == false
- end
-
- it "allows closing the original IO without affecting the new one" do
- @f.close
- lambda { @i.gets }.should_not raise_error(Exception)
-
- @i.closed?.should == false
- @f.closed?.should == true
- end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.dup }.should raise_error(IOError)
- end
-end
Copied: MacRuby/branches/experimental/spec/frozen/core/io/dup_spec_disabled.rb (from rev 1707, MacRuby/branches/experimental/spec/frozen/core/io/dup_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/dup_spec_disabled.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/dup_spec_disabled.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,75 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#dup" do
+ before :all do
+ @file = tmp("rubinius_spec_io_dup_#{$$}_#{Time.now.to_f}")
+ end
+
+ before :each do
+ @f = File.open @file, 'w+'
+ @i = @f.dup
+
+ @f.sync = true
+ @i.sync = true
+ end
+
+ after :each do
+ @i.close unless @i.closed?
+ @f.close unless @f.closed?
+ end
+
+ after :all do
+ File.unlink @file if File.exists?(@file)
+ end
+
+ it "returns a new IO instance" do
+ @i.class.should == @f.class
+ end
+
+ it "sets a new descriptor on the returned object" do
+ @i.fileno.should_not == @f.fileno
+ end
+
+quarantine! do # This does not appear to be consistent across platforms
+ it "shares the original stream between the two IOs" do
+ start = @f.pos
+ @i.pos.should == start
+
+ s = "Hello, wo.. wait, where am I?\n"
+ s2 = "<evil voice> Muhahahaa!"
+
+ @f.write s
+ @i.pos.should == @f.pos
+
+ @i.rewind
+ @i.gets.should == s
+
+ @i.rewind
+ @i.write s2
+
+ @f.rewind
+ @f.gets.should == "#{s2}\n"
+ end
+end
+
+ it "allows closing the new IO without affecting the original" do
+ @i.close
+ lambda { @f.gets }.should_not raise_error(Exception)
+
+ @i.closed?.should == true
+ @f.closed?.should == false
+ end
+
+ it "allows closing the original IO without affecting the new one" do
+ @f.close
+ lambda { @i.gets }.should_not raise_error(Exception)
+
+ @i.closed?.should == false
+ @f.closed?.should == true
+ end
+
+ it "raises IOError on closed stream" do
+ lambda { IOSpecs.closed_file.dup }.should raise_error(IOError)
+ end
+end
Deleted: MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec.rb 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,37 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-
-describe "IO#initialize" do
- before :each do
- @io = IO.allocate
- end
-
- it "succeeds when fd is a Fixnum" do
- lambda { @io.send :initialize, $stdout.fileno, 'w' }.should_not raise_error(TypeError)
- end
-
- it "succeeds when fd responds to #to_int" do
- obj = mock('fileno')
- def obj.to_int() $stdout.fileno end
-
- lambda { @io.send :initialize, obj, 'w' }.should_not raise_error(TypeError)
- end
-
- it "raises a TypeError when fd is an IO" do
- lambda { @io.send :initialize, $stdout, 'w' }.should raise_error(TypeError)
- end
-
- it "raises a TypeError when given a non-integer" do
- lambda { @io.send :initialize, @fname, 'w' }.should raise_error(TypeError)
- end
-
- it "raises IOError on closed stream" do
- lambda { @io.send :initialize, IOSpecs.closed_file.fileno }.should raise_error(IOError)
- end
-
- # MacRuby TODO: for some reason only compiling this method leads to abort
- # when running in spec:ci eventhough the example is tagged as critical.
- # it "raises an Errno::EBADF when given an invalid file descriptor" do
- # lambda { @io.send :initialize, -1, 'w' }.should raise_error(Errno::EBADF)
- # end
-end
Copied: MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec_disabled.rb (from rev 1707, MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec_disabled.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/initialize_spec_disabled.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#initialize" do
+ before :each do
+ @io = IO.allocate
+ end
+
+ it "succeeds when fd is a Fixnum" do
+ lambda { @io.send :initialize, $stdout.fileno, 'w' }.should_not raise_error(TypeError)
+ end
+
+ it "succeeds when fd responds to #to_int" do
+ obj = mock('fileno')
+ def obj.to_int() $stdout.fileno end
+
+ lambda { @io.send :initialize, obj, 'w' }.should_not raise_error(TypeError)
+ end
+
+ it "raises a TypeError when fd is an IO" do
+ lambda { @io.send :initialize, $stdout, 'w' }.should raise_error(TypeError)
+ end
+
+ it "raises a TypeError when given a non-integer" do
+ lambda { @io.send :initialize, @fname, 'w' }.should raise_error(TypeError)
+ end
+
+ it "raises IOError on closed stream" do
+ lambda { @io.send :initialize, IOSpecs.closed_file.fileno }.should raise_error(IOError)
+ end
+
+ # MacRuby TODO: for some reason only compiling this method leads to abort
+ # when running in spec:ci eventhough the example is tagged as critical.
+ # it "raises an Errno::EBADF when given an invalid file descriptor" do
+ # lambda { @io.send :initialize, -1, 'w' }.should raise_error(Errno::EBADF)
+ # end
+end
Deleted: MacRuby/branches/experimental/spec/frozen/core/io/lines_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/lines_spec.rb 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/core/io/lines_spec.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,34 +0,0 @@
-# encoding: utf-8
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-
-ruby_version_is '1.8.7' do
- describe "IO#lines" do
- before(:each) do
- @io = File.open(IOSpecs.gets_fixtures)
- end
-
- after(:each) do
- @io.close
- end
-
- it "returns an Enumerator" do
- enum = @io.lines
- enum.instance_of?(enumerator_class).should be_true
-
- enum.to_a.should == ["Voici la ligne une.\n",
- "Qui è la linea due.\n",
- "\n",
- "\n",
- "Aquí está la línea tres.\n",
- "Ist hier Linie vier.\n",
- "\n",
- "Está aqui a linha cinco.\n",
- "Here is line six.\n"]
- end
-
- it "ignores a given block" do
- @io.lines{ raise "oups" }.instance_of?(enumerator_class).should be_true
- end
- end
-end
\ No newline at end of file
Copied: MacRuby/branches/experimental/spec/frozen/core/io/lines_spec_disabled.rb (from rev 1707, MacRuby/branches/experimental/spec/frozen/core/io/lines_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/lines_spec_disabled.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/lines_spec_disabled.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,34 @@
+# encoding: utf-8
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+ruby_version_is '1.8.7' do
+ describe "IO#lines" do
+ before(:each) do
+ @io = File.open(IOSpecs.gets_fixtures)
+ end
+
+ after(:each) do
+ @io.close
+ end
+
+ it "returns an Enumerator" do
+ enum = @io.lines
+ enum.instance_of?(enumerator_class).should be_true
+
+ enum.to_a.should == ["Voici la ligne une.\n",
+ "Qui è la linea due.\n",
+ "\n",
+ "\n",
+ "Aquí está la línea tres.\n",
+ "Ist hier Linie vier.\n",
+ "\n",
+ "Está aqui a linha cinco.\n",
+ "Here is line six.\n"]
+ end
+
+ it "ignores a given block" do
+ @io.lines{ raise "oups" }.instance_of?(enumerator_class).should be_true
+ end
+ end
+end
\ No newline at end of file
Deleted: MacRuby/branches/experimental/spec/frozen/core/io/printf_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/printf_spec.rb 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/core/io/printf_spec.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,18 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-
-describe "IO#printf" do
- before :each do
- @io = IO.new STDOUT.fileno, 'w'
- end
-
- it "writes the #sprintf formatted string to the file descriptor" do
- lambda {
- @io.printf "%s\n", "look ma, no hands"
- }.should output_to_fd("look ma, no hands\n", @io)
- end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.printf("stuff") }.should raise_error(IOError)
- end
-end
Copied: MacRuby/branches/experimental/spec/frozen/core/io/printf_spec_disabled.rb (from rev 1707, MacRuby/branches/experimental/spec/frozen/core/io/printf_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/printf_spec_disabled.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/printf_spec_disabled.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#printf" do
+ before :each do
+ @io = IO.new STDOUT.fileno, 'w'
+ end
+
+ it "writes the #sprintf formatted string to the file descriptor" do
+ lambda {
+ @io.printf "%s\n", "look ma, no hands"
+ }.should output_to_fd("look ma, no hands\n", @io)
+ end
+
+ it "raises IOError on closed stream" do
+ lambda { IOSpecs.closed_file.printf("stuff") }.should raise_error(IOError)
+ end
+end
Deleted: MacRuby/branches/experimental/spec/frozen/core/io/puts_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/puts_spec.rb 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/core/io/puts_spec.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,84 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-
-# TODO: need to find a better way to test this. Too fragile to set expectations
-# to each write call. Only care that all the characters are sent not the number
-# or write calls. Also, these tests do not make sure the ordering of the write calls
-# are correct.
-describe "IO#puts" do
- before(:each) do
- @io = IO.new(2, 'w')
- end
-
- it "writes just a newline when given no args" do
- @io.should_receive(:write).with("\n")
- @io.puts.should == nil
- end
-
- it "writes just a newline when given just a newline" do
- lambda { $stdout.puts "\n" }.should output_to_fd("\n", STDOUT)
- end
-
- it "writes nil with a newline when given nil as an arg" do
- @io.should_receive(:write).with("nil")
- @io.should_receive(:write).with("\n")
- @io.puts(nil).should == nil
- end
-
- it "calls to_s before writing non-string objects" do
- object = mock('hola')
- object.should_receive(:to_s).and_return("hola")
-
- @io.should_receive(:write).with("hola")
- @io.should_receive(:write).with("\n")
- @io.puts(object).should == nil
- end
-
- it "writes each arg if given several" do
- @io.should_receive(:write).with("1")
- @io.should_receive(:write).with("two")
- @io.should_receive(:write).with("3")
- @io.should_receive(:write).with("\n").exactly(3).times
- @io.puts(1, "two", 3).should == nil
- end
-
- it "flattens a nested array before writing it" do
- @io.should_receive(:write).with("1")
- @io.should_receive(:write).with("2")
- @io.should_receive(:write).with("3")
- @io.should_receive(:write).with("\n").exactly(3).times
- @io.puts([1, 2, [3]]).should == nil
- end
-
- it "writes [...] for a recursive array arg" do
- x = []
- x << 2 << x
- @io.should_receive(:write).with("2")
- @io.should_receive(:write).with("[...]")
- @io.should_receive(:write).with("\n").exactly(2).times
- @io.puts(x).should == nil
- end
-
- it "writes a newline after objects that do not end in newlines" do
- @io.should_receive(:write).with("5")
- @io.should_receive(:write).with("\n")
- @io.puts(5).should == nil
- end
-
- it "does not write a newline after objects that end in newlines" do
- @io.should_receive(:write).with("5\n")
- @io.puts("5\n").should == nil
- end
-
- it "ignores the $/ separator global" do
- $/ = ":"
- @io.should_receive(:write).with("5")
- @io.should_receive(:write).with("\n")
- @io.puts(5).should == nil
- $/ = "\n"
- end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.puts("stuff") }.should raise_error(IOError)
- end
-end
Copied: MacRuby/branches/experimental/spec/frozen/core/io/puts_spec_disabled.rb (from rev 1707, MacRuby/branches/experimental/spec/frozen/core/io/puts_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/puts_spec_disabled.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/puts_spec_disabled.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,84 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+# TODO: need to find a better way to test this. Too fragile to set expectations
+# to each write call. Only care that all the characters are sent not the number
+# or write calls. Also, these tests do not make sure the ordering of the write calls
+# are correct.
+describe "IO#puts" do
+ before(:each) do
+ @io = IO.new(2, 'w')
+ end
+
+ it "writes just a newline when given no args" do
+ @io.should_receive(:write).with("\n")
+ @io.puts.should == nil
+ end
+
+ it "writes just a newline when given just a newline" do
+ lambda { $stdout.puts "\n" }.should output_to_fd("\n", STDOUT)
+ end
+
+ it "writes nil with a newline when given nil as an arg" do
+ @io.should_receive(:write).with("nil")
+ @io.should_receive(:write).with("\n")
+ @io.puts(nil).should == nil
+ end
+
+ it "calls to_s before writing non-string objects" do
+ object = mock('hola')
+ object.should_receive(:to_s).and_return("hola")
+
+ @io.should_receive(:write).with("hola")
+ @io.should_receive(:write).with("\n")
+ @io.puts(object).should == nil
+ end
+
+ it "writes each arg if given several" do
+ @io.should_receive(:write).with("1")
+ @io.should_receive(:write).with("two")
+ @io.should_receive(:write).with("3")
+ @io.should_receive(:write).with("\n").exactly(3).times
+ @io.puts(1, "two", 3).should == nil
+ end
+
+ it "flattens a nested array before writing it" do
+ @io.should_receive(:write).with("1")
+ @io.should_receive(:write).with("2")
+ @io.should_receive(:write).with("3")
+ @io.should_receive(:write).with("\n").exactly(3).times
+ @io.puts([1, 2, [3]]).should == nil
+ end
+
+ it "writes [...] for a recursive array arg" do
+ x = []
+ x << 2 << x
+ @io.should_receive(:write).with("2")
+ @io.should_receive(:write).with("[...]")
+ @io.should_receive(:write).with("\n").exactly(2).times
+ @io.puts(x).should == nil
+ end
+
+ it "writes a newline after objects that do not end in newlines" do
+ @io.should_receive(:write).with("5")
+ @io.should_receive(:write).with("\n")
+ @io.puts(5).should == nil
+ end
+
+ it "does not write a newline after objects that end in newlines" do
+ @io.should_receive(:write).with("5\n")
+ @io.puts("5\n").should == nil
+ end
+
+ it "ignores the $/ separator global" do
+ $/ = ":"
+ @io.should_receive(:write).with("5")
+ @io.should_receive(:write).with("\n")
+ @io.puts(5).should == nil
+ $/ = "\n"
+ end
+
+ it "raises IOError on closed stream" do
+ lambda { IOSpecs.closed_file.puts("stuff") }.should raise_error(IOError)
+ end
+end
Deleted: MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec.rb 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,41 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-
-describe "IO#rewind" do
- before :each do
- @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
- @io = IO.open @file.fileno, 'r'
- end
-
- after :each do
- # we *must* close both in order to not leak descriptors
- @io.close unless @io.closed?
- @file.close unless @file.closed? rescue Errno::EBADF
- end
-
- it "positions the instance to the beginning of input" do
- @io.readline.should == "Voici la ligne une.\n"
- @io.readline.should == "Qui è la linea due.\n"
- @io.rewind
- @io.readline.should == "Voici la ligne une.\n"
- end
-
- it "positions the instance to the beginning of input and clears EOF" do
- value = @io.read
- @io.rewind
- @io.eof?.should == false
- value.should == @io.read
- end
-
- it "sets lineno to 0" do
- @io.readline.should == "Voici la ligne une.\n"
- @io.lineno.should == 1
- @io.rewind
- @io.lineno.should == 0
- end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.rewind }.should raise_error(IOError)
- end
-end
Copied: MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec_disabled.rb (from rev 1707, MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec_disabled.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/rewind_spec_disabled.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,41 @@
+# -*- encoding: utf-8 -*-
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#rewind" do
+ before :each do
+ @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
+ @io = IO.open @file.fileno, 'r'
+ end
+
+ after :each do
+ # we *must* close both in order to not leak descriptors
+ @io.close unless @io.closed?
+ @file.close unless @file.closed? rescue Errno::EBADF
+ end
+
+ it "positions the instance to the beginning of input" do
+ @io.readline.should == "Voici la ligne une.\n"
+ @io.readline.should == "Qui è la linea due.\n"
+ @io.rewind
+ @io.readline.should == "Voici la ligne une.\n"
+ end
+
+ it "positions the instance to the beginning of input and clears EOF" do
+ value = @io.read
+ @io.rewind
+ @io.eof?.should == false
+ value.should == @io.read
+ end
+
+ it "sets lineno to 0" do
+ @io.readline.should == "Voici la ligne une.\n"
+ @io.lineno.should == 1
+ @io.rewind
+ @io.lineno.should == 0
+ end
+
+ it "raises IOError on closed stream" do
+ lambda { IOSpecs.closed_file.rewind }.should raise_error(IOError)
+ end
+end
Deleted: MacRuby/branches/experimental/spec/frozen/core/io/seek_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/seek_spec.rb 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/core/io/seek_spec.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,74 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-
-describe "IO#seek" do
- before :each do
- @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
- @io = IO.open @file.fileno, 'r'
- end
-
- after :each do
- # we *must* close both in order to not leak descriptors
- @io.close unless @io.closed?
- @file.close unless @file.closed? rescue Errno::EBADF
- end
-
- it "moves the read position relative to the current position with SEEK_CUR" do
- lambda { @io.seek(-1) }.should raise_error(Errno::EINVAL)
- @io.seek(10, IO::SEEK_CUR)
- @io.readline.should == "igne une.\n"
- @io.seek(-5, IO::SEEK_CUR)
- @io.readline.should == "une.\n"
- end
-
- it "moves the read position relative to the start with SEEK_SET" do
- @io.seek(1)
- @io.pos.should == 1
- @io.rewind
- @io.seek(42, IO::SEEK_SET)
- @io.readline.should == "quí está la línea tres.\n"
- @io.seek(5, IO::SEEK_SET)
- @io.readline.should == " la ligne une.\n"
- end
-
- it "moves the read position relative to the end with SEEK_END" do
- @io.seek(0, IO::SEEK_END)
- @io.tell.should == 134
- @io.seek(-25, IO::SEEK_END)
- @io.readline.should == "cinco.\n"
- end
-
- it "can handle any numerical argument without breaking" do
- @io.seek(1.2).should == 0
- @io.seek(2**32).should == 0
- @io.seek(1.23423423432e12).should == 0
- @io.seek(0.00000000000000000000001).should == 0
- lambda { @io.seek(2**128) }.should raise_error(RangeError)
- end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.seek(0) }.should raise_error(IOError)
- end
-
- it "moves the read position and clears EOF with SEEK_SET" do
- value = @io.read
- @io.seek(0, IO::SEEK_SET)
- @io.eof?.should == false
- value.should == @io.read
- end
-
- it "moves the read position and clears EOF with SEEK_CUR" do
- value = @io.read
- @io.seek(-1, IO::SEEK_CUR)
- @io.eof?.should == false
- value[-1].should == @io.read[0]
- end
-
- it "moves the read position and clears EOF with SEEK_END" do
- value = @io.read
- @io.seek(-1, IO::SEEK_END)
- @io.eof?.should == false
- value[-1].should == @io.read[0]
- end
-end
Copied: MacRuby/branches/experimental/spec/frozen/core/io/seek_spec_disabled.rb (from rev 1707, MacRuby/branches/experimental/spec/frozen/core/io/seek_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/seek_spec_disabled.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/seek_spec_disabled.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,74 @@
+# -*- encoding: utf-8 -*-
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#seek" do
+ before :each do
+ @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
+ @io = IO.open @file.fileno, 'r'
+ end
+
+ after :each do
+ # we *must* close both in order to not leak descriptors
+ @io.close unless @io.closed?
+ @file.close unless @file.closed? rescue Errno::EBADF
+ end
+
+ it "moves the read position relative to the current position with SEEK_CUR" do
+ lambda { @io.seek(-1) }.should raise_error(Errno::EINVAL)
+ @io.seek(10, IO::SEEK_CUR)
+ @io.readline.should == "igne une.\n"
+ @io.seek(-5, IO::SEEK_CUR)
+ @io.readline.should == "une.\n"
+ end
+
+ it "moves the read position relative to the start with SEEK_SET" do
+ @io.seek(1)
+ @io.pos.should == 1
+ @io.rewind
+ @io.seek(42, IO::SEEK_SET)
+ @io.readline.should == "quí está la línea tres.\n"
+ @io.seek(5, IO::SEEK_SET)
+ @io.readline.should == " la ligne une.\n"
+ end
+
+ it "moves the read position relative to the end with SEEK_END" do
+ @io.seek(0, IO::SEEK_END)
+ @io.tell.should == 134
+ @io.seek(-25, IO::SEEK_END)
+ @io.readline.should == "cinco.\n"
+ end
+
+ it "can handle any numerical argument without breaking" do
+ @io.seek(1.2).should == 0
+ @io.seek(2**32).should == 0
+ @io.seek(1.23423423432e12).should == 0
+ @io.seek(0.00000000000000000000001).should == 0
+ lambda { @io.seek(2**128) }.should raise_error(RangeError)
+ end
+
+ it "raises IOError on closed stream" do
+ lambda { IOSpecs.closed_file.seek(0) }.should raise_error(IOError)
+ end
+
+ it "moves the read position and clears EOF with SEEK_SET" do
+ value = @io.read
+ @io.seek(0, IO::SEEK_SET)
+ @io.eof?.should == false
+ value.should == @io.read
+ end
+
+ it "moves the read position and clears EOF with SEEK_CUR" do
+ value = @io.read
+ @io.seek(-1, IO::SEEK_CUR)
+ @io.eof?.should == false
+ value[-1].should == @io.read[0]
+ end
+
+ it "moves the read position and clears EOF with SEEK_END" do
+ value = @io.read
+ @io.seek(-1, IO::SEEK_END)
+ @io.eof?.should == false
+ value[-1].should == @io.read[0]
+ end
+end
Deleted: MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec.rb 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,71 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-
-describe "IO#sysseek on a file" do
- # TODO: This should be made more generic with seek spec
- before :each do
- @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
- @io = IO.open @file.fileno, 'r'
- end
-
- after :each do
- # we *must* close both in order to not leak descriptors
- @io.close unless @io.closed?
- @file.close unless @file.closed? rescue Errno::EBADF
- end
-
- it "moves the read position relative to the current position with SEEK_CUR" do
- @io.sysseek(10, IO::SEEK_CUR)
- @io.readline.should == "igne une.\n"
- end
-
- it "raises an error when called after buffered reads" do
- @io.readline
- lambda { @io.sysseek(-5, IO::SEEK_CUR) }.should raise_error(IOError)
- end
-
- it "warns if called immediately after a buffered IO#write" do
- begin
- # copy contents to a separate file
- tmpfile = File.open(tmp("tmp_IO_sysseek"), "w")
- tmpfile.write(@file.read)
- tmpfile.seek(0, File::SEEK_SET)
-
- tmpfile.write("abcde")
- lambda { tmpfile.sysseek(10) }.should complain(/sysseek/)
- ensure
- tmpfile.close
- File.unlink(tmpfile.path)
- end
- end
-
- it "moves the read position relative to the start with SEEK_SET" do
- @io.sysseek(42, IO::SEEK_SET)
- @io.readline.should == "quí está la línea tres.\n"
- end
-
- it "moves the read position relative to the end with SEEK_END" do
- @io.sysseek(1, IO::SEEK_END)
-
- # this is the safest way of checking the EOF when
- # sys-* methods are invoked
- lambda {
- @io.sysread(1)
- }.should raise_error(EOFError)
-
- @io.sysseek(-25, IO::SEEK_END)
- @io.sysread(7).should == "cinco.\n"
- end
-
- it "can handle any numerical argument without breaking and can seek past EOF" do
- @io.sysseek(1.2).should == 1
- @io.sysseek(2**10).should == 1024
- @io.sysseek(2**32).should == 4294967296
- lambda { @io.sysseek(2**128) }.should raise_error(RangeError)
- end
-
- it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_file.sysseek(0) }.should raise_error(IOError)
- end
-end
Copied: MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec_disabled.rb (from rev 1707, MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec_disabled.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/sysseek_spec_disabled.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,71 @@
+# -*- encoding: utf-8 -*-
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "IO#sysseek on a file" do
+ # TODO: This should be made more generic with seek spec
+ before :each do
+ @file = File.open(File.dirname(__FILE__) + '/fixtures/readlines.txt', 'r')
+ @io = IO.open @file.fileno, 'r'
+ end
+
+ after :each do
+ # we *must* close both in order to not leak descriptors
+ @io.close unless @io.closed?
+ @file.close unless @file.closed? rescue Errno::EBADF
+ end
+
+ it "moves the read position relative to the current position with SEEK_CUR" do
+ @io.sysseek(10, IO::SEEK_CUR)
+ @io.readline.should == "igne une.\n"
+ end
+
+ it "raises an error when called after buffered reads" do
+ @io.readline
+ lambda { @io.sysseek(-5, IO::SEEK_CUR) }.should raise_error(IOError)
+ end
+
+ it "warns if called immediately after a buffered IO#write" do
+ begin
+ # copy contents to a separate file
+ tmpfile = File.open(tmp("tmp_IO_sysseek"), "w")
+ tmpfile.write(@file.read)
+ tmpfile.seek(0, File::SEEK_SET)
+
+ tmpfile.write("abcde")
+ lambda { tmpfile.sysseek(10) }.should complain(/sysseek/)
+ ensure
+ tmpfile.close
+ File.unlink(tmpfile.path)
+ end
+ end
+
+ it "moves the read position relative to the start with SEEK_SET" do
+ @io.sysseek(42, IO::SEEK_SET)
+ @io.readline.should == "quí está la línea tres.\n"
+ end
+
+ it "moves the read position relative to the end with SEEK_END" do
+ @io.sysseek(1, IO::SEEK_END)
+
+ # this is the safest way of checking the EOF when
+ # sys-* methods are invoked
+ lambda {
+ @io.sysread(1)
+ }.should raise_error(EOFError)
+
+ @io.sysseek(-25, IO::SEEK_END)
+ @io.sysread(7).should == "cinco.\n"
+ end
+
+ it "can handle any numerical argument without breaking and can seek past EOF" do
+ @io.sysseek(1.2).should == 1
+ @io.sysseek(2**10).should == 1024
+ @io.sysseek(2**32).should == 4294967296
+ lambda { @io.sysseek(2**128) }.should raise_error(RangeError)
+ end
+
+ it "raises IOError on closed stream" do
+ lambda { IOSpecs.closed_file.sysseek(0) }.should raise_error(IOError)
+ end
+end
Deleted: MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec.rb 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,39 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-require File.dirname(__FILE__) + '/shared/write'
-
-describe "IO#write_nonblock on a file" do
- before :each do
- @filename = tmp("IO_syswrite_file") + $$.to_s
- File.open(@filename, "w") do |file|
- file.write_nonblock("012345678901234567890123456789")
- end
- @file = File.open(@filename, "r+")
- @readonly_file = File.open(@filename)
- end
-
- after :each do
- @file.close
- @readonly_file.close
- File.delete(@filename)
- end
-
- it "writes all of the string's bytes but does not buffer them" do
- written = @file.write_nonblock("abcde")
- written.should == 5
- File.open(@filename) do |file|
- file.sysread(10).should == "abcde56789"
- file.seek(0)
- @file.fsync
- file.sysread(10).should == "abcde56789"
- end
- end
-
- it "checks if the file is writable if writing zero bytes" do
- lambda { @readonly_file.write_nonblock("") }.should raise_error
- end
-end
-
-describe "IO#write_nonblock" do
- it_behaves_like :io_write, :write_nonblock
-end
Copied: MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec_disabled.rb (from rev 1707, MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec_disabled.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/io/write_nonblock_spec_disabled.rb 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,39 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+require File.dirname(__FILE__) + '/shared/write'
+
+describe "IO#write_nonblock on a file" do
+ before :each do
+ @filename = tmp("IO_syswrite_file") + $$.to_s
+ File.open(@filename, "w") do |file|
+ file.write_nonblock("012345678901234567890123456789")
+ end
+ @file = File.open(@filename, "r+")
+ @readonly_file = File.open(@filename)
+ end
+
+ after :each do
+ @file.close
+ @readonly_file.close
+ File.delete(@filename)
+ end
+
+ it "writes all of the string's bytes but does not buffer them" do
+ written = @file.write_nonblock("abcde")
+ written.should == 5
+ File.open(@filename) do |file|
+ file.sysread(10).should == "abcde56789"
+ file.seek(0)
+ @file.fsync
+ file.sysread(10).should == "abcde56789"
+ end
+ end
+
+ it "checks if the file is writable if writing zero bytes" do
+ lambda { @readonly_file.write_nonblock("") }.should raise_error
+ end
+end
+
+describe "IO#write_nonblock" do
+ it_behaves_like :io_write, :write_nonblock
+end
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/bytes_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/bytes_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/bytes_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,3 @@
+fails:IO#bytes returns an enumerator of the next bytes from the stream
+fails:IO#bytes ignores a block
+fails:IO#bytes raises IOError on closed stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/chars_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/chars_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/chars_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,3 @@
+fails:IO#chars returns an enumerator of the next chars from the stream
+fails:IO#chars ignores a block
+fails:IO#chars raises IOError on closed stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/close_read_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/close_read_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/close_read_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,3 @@
+fails:IO#close_read raises an IOError on subsequent invocations
+fails:IO#close_read raises an IOError if the stream is writable and not duplexed
+fails:IO#close_read raises IOError on closed stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/close_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/close_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/close_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,4 @@
+fails:IO#close raises an IOError on subsequent invocations
+fails:IO#close raises when a file descriptor is closed twice
+fails:IO#close on an IO.popen stream sets $?
+fails:IO#close on an IO.popen stream waits for the child to exit
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/data/data_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/data/data_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/data/data_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1 @@
+fails:DATA presents $0 file data after __END__ as a File object
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/data/flock_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/data/flock_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/data/flock_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1 @@
+fails:DATA.flock succeeds in locking the file DATA came from
Modified: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_byte_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_byte_tags.txt 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_byte_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,2 +1,2 @@
fails:IO#each_byte yields each byte
-fails:IO#each_byte returns an Enumerator when passed no block
\ No newline at end of file
+fails:IO#each_byte returns an Enumerator when passed no block
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_char_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_char_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_char_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,2 @@
+fails:IO#each_char yields each character
+fails:IO#each_char returns an Enumerator when passed no block
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_line_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_line_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_line_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,6 @@
+critical:IO#each_line when passed a separator tries to convert the passed separator to a String using #to_str
+fails:IO#each_line does not change $_
+fails:IO#each_line returns an Enumerator when passed no block
+fails:IO#each_line when passed a separator does not change $_
+fails:IO#each_line when passed a separator yields self's content starting from the current position when the passed separator is nil
+fails:IO#each_line when passed a separator yields each paragraph when passed an empty String as separator
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/each_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,6 @@
+critical:IO#each when passed a separator tries to convert the passed separator to a String using #to_str
+fails:IO#each does not change $_
+fails:IO#each returns an Enumerator when passed no block
+fails:IO#each when passed a separator does not change $_
+fails:IO#each when passed a separator yields self's content starting from the current position when the passed separator is nil
+fails:IO#each when passed a separator yields each paragraph when passed an empty String as separator
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/eof_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/eof_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/eof_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,6 @@
+fails:IO#eof? returns true after reading with read
+fails:IO#eof? returns true after reading with sysread
+fails:IO#eof? returns true on just opened empty stream
+fails:IO#eof? should not consume the data from the stream
+fails:IO#eof? returns true on one-byte stream after single-byte read
+fails:IO#eof? returns true on receiving side of Pipe when writing side is closed
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/for_fd_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/for_fd_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/for_fd_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,3 @@
+fails:IO.for_fd associates new IO with the old descriptor so each IO directly affects the other
+fails:IO.for_fd raises EINVAL if mode is not compatible with the descriptor's current mode
+fails:IO.for_fd cannot open an IO with incompatible flags
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/foreach_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/foreach_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/foreach_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,6 @@
+fails:IO::foreach yields a sequence of Strings that were separated by r
+fails:IO::foreach yields a single string with entire content when the separator is nil
+fails:IO::foreach yields a sequence of paragraphs when the separator is an empty string
+fails:IO::foreach updates $. with each yield
+fails:IO::foreach can handle non-ASCII data as separator
+fails:IO::foreach converts second parameter to string and uses as separator
Modified: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/getc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/getc_tags.txt 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/getc_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1 +1 @@
-fails:IO#getc returns the next character from the stream
\ No newline at end of file
+fails:IO#getc returns the next character from the stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/gets_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/gets_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/gets_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,9 @@
+fails:IO#gets returns tainted strings
+fails:IO#gets updates lineno with each invocation
+fails:IO#gets updates $. with each invocation
+fails:IO#gets assigns the returned line to $_
+fails:IO#gets returns the entire content if the separator is nil
+fails:IO#gets returns the next paragraph if the separator's length is 0
+fails:IO#gets reads until the beginning of the next paragraph when the separator's length is 0
+fails:IO#gets fails on cloned opened streams
+fails:IO#gets accepts a separator
Deleted: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/initialize_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/initialize_tags.txt 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/initialize_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1 +0,0 @@
-critical:IO#initialize raises an Errno::EBADF when given an invalid file descriptor
\ No newline at end of file
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/isatty_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/isatty_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/isatty_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1 @@
+fails:IO#isatty raises IOError on closed stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/lineno_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/lineno_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/lineno_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,5 @@
+fails:IO#lineno raises IOError on closed stream
+fails:IO#lineno returns the current line number
+fails:IO#lineno= raises IOError on closed stream
+fails:IO#lineno= sets the current line number to the given value
+fails:IO#lineno= does not change $. until next read
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/new_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/new_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,3 @@
+fails:IO.new associates new IO with the old descriptor so each IO directly affects the other
+fails:IO.new raises EINVAL if mode is not compatible with the descriptor's current mode
+fails:IO.new cannot open an IO with incompatible flags
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/open_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/open_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/open_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,5 @@
+fails:IO.open associates new IO with the old descriptor so each IO directly affects the other
+fails:IO.open raises EINVAL if mode is not compatible with the descriptor's current mode
+fails:IO.open cannot open an IO with incompatible flags
+fails:IO.open with a block invokes close on opened IO object when exiting the block
+fails:IO.open with a block propagates non-StandardErrors produced by close
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/output_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/output_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/output_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,2 @@
+fails:IO#<< writes an object to the IO stream
+fails:IO#<< calls #to_s on the object to print it
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/popen_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/popen_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/popen_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,2 @@
+fails:IO::popen reads and writes to a read/write pipe
+fails:IO::popen writes to a write-only pipe
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/print_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/print_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/print_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,2 @@
+fails:IO#print writes $_.to_s followed by $\ (if any) to the stream if no arguments given
+fails:IO#print raises IOError on closed stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/read_nonblock_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/read_nonblock_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/read_nonblock_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1 @@
+fails:IO#read_nonblock raises IOError on closed stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/read_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/read_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/read_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,11 @@
+fails:IO.read raises an ArgumentError when not passed a valid length
+fails:IO.read raises an Errno::EINVAL when not passed a valid offset
+fails:IO#read can read lots of data
+fails:IO#read can read lots of data with length
+fails:IO#read places the specified number of bytes in the buffer
+fails:IO#read expands the buffer when too small
+fails:IO#read overwrites the buffer
+fails:IO#read truncates the buffer when too big
+fails:IO#read returns the given buffer
+fails:IO#read coerces the second argument to string and uses it as a buffer
+fails:IO#read ignores unicode encoding
Deleted: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readchar_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readchar_tags.txt 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readchar_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1 +0,0 @@
-fails:IO#readchar raises EOFError on empty stream
\ No newline at end of file
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readlines_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readlines_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readlines_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,13 @@
+critical:IO#readlines when passed [separator] tries to convert the passed separator to a String using #to_str
+fails:IO#readlines when passed no arguments updates self's lineno based on the number of lines read
+fails:IO#readlines when passed no arguments does not change $_
+fails:IO#readlines when passed [separator] updates self's lineno based on the number of lines read
+fails:IO#readlines when passed [separator] does not change $_
+fails:IO#readlines when passed [separator] returns an Array containing all paragraphs when the passed separator is an empty String
+fails:IO#readlines when passed [separator] returns the remaining content as one line starting at the current position when passed nil
+fails:IO.readlines when passed [file_name] returns an Array containing lines of file_name based on $/
+fails:IO.readlines when passed [file_name] does not change $_
+fails:IO#readlines when passed [file_name, separator] returns an Array containing lines of file_name based on the passed separator
+fails:IO#readlines when passed [file_name, separator] does not change $_
+fails:IO#readlines when passed [file_name, separator] returns an Array containing all paragraphs when the passed separator is an empty String
+fails:IO#readlines when passed [file_name, separator] tries to convert the passed separator to a String using #to_str
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readpartial_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readpartial_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/readpartial_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,10 @@
+fails:IO#readpartial raises IOError on closed stream
+fails:IO#readpartial reads at most the specified number of bytes
+fails:IO#readpartial reads after ungetc with data in the buffer
+fails:IO#readpartial reads after ungetc without data in the buffer
+fails:IO#readpartial discards the existing buffer content upon successful read
+fails:IO#readpartial raises EOFError on EOF
+fails:IO#readpartial discards the existing buffer content upon error
+fails:IO#readpartial raises IOError if the stream is closed
+fails:IO#readpartial raises ArgumentError if the negative argument is provided
+fails:IO#readpartial immediately returns an empty string if the length argument is 0
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/reopen_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/reopen_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/reopen_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,8 @@
+fails:IO#reopen raises IOError on closed stream
+fails:IO#reopen reassociates self to another file/descriptor but returns self
+fails:IO#reopen reassociates self with a new stream opened on path, when self in initial state
+fails:IO#reopen reassociates self with a new stream opened on path, after some reads
+fails:IO#reopen reassociates self with a new stream opened on path, after some writes
+fails:IO#reopen reassociates self with the I/O stream specified as an argument, after some reads
+fails:IO#reopen reassociates self with the I/O stream specified as an argument, after some writes
+fails:IO#reopen reassociates self with new a new stream after some reads
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/select_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/select_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/select_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,11 @@
+fails:IO.select blocks for duration of timeout if there are no objects ready for I/O
+fails:IO.select returns immediately all objects that are ready for I/O when timeout is 0
+fails:IO.select returns nil after timeout if there are no objects ready for I/O
+fails:IO.select returns supplied objects when they are ready for I/O
+fails:IO.select returns supplied objects correctly even when monitoring the same object in different arrays
+fails:IO.select invokes to_io on supplied objects that are not IO
+fails:IO.select raises TypeError if supplied objects are not IO
+fails:IO.select raises TypeError if the specified timeout value is not Numeric
+fails:IO.select raises TypeError if the first three arguments are not Arrays
+fails:IO.select does not raise errors if the first three arguments are nil
+fails:IO.select does not accept negative timeouts
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/stat_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/stat_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/stat_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1 @@
+critical:IO#stat raises IOError on closed stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/sysread_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/sysread_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/sysread_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,2 @@
+fails:IO#sysread on a file reads the specified number of bytes from the file to the buffer
+fails:IO#sysread on a file coerces the second argument to string and uses it as a buffer
Deleted: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/syswrite_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/syswrite_tags.txt 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/syswrite_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,2 +0,0 @@
-fails:IO#syswrite coerces the argument to a string using to_s
-fails:IO#syswrite invokes to_s on non-String argument
\ No newline at end of file
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/to_io_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/to_io_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/to_io_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1 @@
+fails:IO#to_io returns self for open stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/tty_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/tty_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/tty_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1 @@
+fails:IO#tty? raises IOError on closed stream
Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/ungetc_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/ungetc_tags.txt (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/io/ungetc_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -0,0 +1,4 @@
+critical:IO#ungetc pushes back one character onto stream
+fails:IO#ungetc affects EOF state
+fails:IO#ungetc adjusts the stream position
+fails:IO#ungetc makes subsequent unbuffered operations to raise IOError
Modified: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/kernel/open_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/kernel/open_tags.txt 2009-06-03 22:05:48 UTC (rev 1712)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/kernel/open_tags.txt 2009-06-03 22:24:14 UTC (rev 1713)
@@ -1,6 +1,5 @@
fails:Kernel#open is a private method
fails:Kernel#open calls #to_open on argument
-fails:An exception occurred during: before :each
fails:Kernel#open opens a file when given a valid filename
fails:Kernel#open opens an io when path starts with a pipe
fails:Kernel#open opens an io when called with a block
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090603/1f581279/attachment-0001.html>
More information about the macruby-changes
mailing list