Sha256: af7f01f3c11e6a48ca676ac69ba86c94d0dc55acead8f1c99f73a874b8356d0b
Contents?: true
Size: 1021 Bytes
Versions: 1
Compression:
Stored size: 1021 Bytes
Contents
#!/usr/local/bin/ruby if $0 == __FILE__ Dir.chdir File.dirname(__FILE__)+'/../' $:.unshift File.expand_path('../lib/') end require 'rio' require 'tc/testcase' require 'tmpdir' class TC_tempfile < Test::RIO::TestCase @@once = false def self.once @@once = true end def setup super self.class.once unless @@once @tmpdir = ::Dir::tmpdir @pfx = 'rio' end def pathinfo(ario) [:scheme,:opaque,:path,:fspath,:to_s,:to_url,:to_uri].each do |sym| puts "#{sym}: #{ario.__send__(sym)}" end end def test_io str = "Hello Tempfile" assert_equal(str,rio(??).puts(str).rewind.chomp.gets) end def test_rl_temp str = "Hello Tempfile" tmp = rio('temp:') assert(tmp.closed?) assert_equal(str,tmp.puts(str).rewind.chomp.gets) end def test_rl_tempfile str = "Hello Tempfile" #$trace_states = true tmp = rio('tempfile:') assert(tmp.closed?) tmp.puts(str) assert(tmp.open?) assert_equal(str,tmp.rewind.chomp.gets) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rio-0.3.7 | test/tc/tempfile.rb |