mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/rexml/test_contrib.rb (ContribTester#test_pos): should not
use fixed path name for tests. [ruby-dev:42827] * test/rexml/test_sax.rb (SAX2Tester#test_socket): should not use fixed port for tests. [ruby-dev:42828] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f4db8aedc8
commit
182b614869
3 changed files with 18 additions and 12 deletions
|
@ -1,3 +1,11 @@
|
|||
Tue Dec 21 06:25:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* test/rexml/test_contrib.rb (ContribTester#test_pos): should not
|
||||
use fixed path name for tests. [ruby-dev:42827]
|
||||
|
||||
* test/rexml/test_sax.rb (SAX2Tester#test_socket): should not use
|
||||
fixed port for tests. [ruby-dev:42828]
|
||||
|
||||
Tue Dec 21 06:10:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* compile.c (setup_args), vm.c (invoke_block_from_c),
|
||||
|
|
|
@ -74,7 +74,7 @@ DELIMITER
|
|||
EOF
|
||||
doc = REXML::Document.new source
|
||||
doc.write(out="")
|
||||
assert(out[/>'>/] != nil, "Couldn't find >'>")
|
||||
assert(out[/>\'>/] != nil, "Couldn't find >'>")
|
||||
assert(out[/\]>/] != nil, "Couldn't find ]>")
|
||||
end
|
||||
|
||||
|
@ -512,7 +512,8 @@ EOL
|
|||
end
|
||||
|
||||
def test_pos
|
||||
testfile = "/tmp/tidal#{$$}"
|
||||
require 'tempfile'
|
||||
testfile = Tempfile.new("tidal")
|
||||
testdata = %Q{<calibration>
|
||||
<section name="parameters">
|
||||
<param name="barpress">760</param>
|
||||
|
@ -521,13 +522,12 @@ EOL
|
|||
</calibration>
|
||||
}
|
||||
|
||||
File.open(testfile, 'w') do |f|
|
||||
f.puts testdata
|
||||
testfile.puts testdata
|
||||
testfile.rewind
|
||||
assert_nothing_raised do
|
||||
d = REXML::Document.new(testfile)
|
||||
end
|
||||
File.open(testfile) do |f|
|
||||
d = REXML::Document.new(f)
|
||||
end
|
||||
#File.unlink(testfile)
|
||||
testfile.close(true)
|
||||
end
|
||||
|
||||
def test_deep_clone
|
||||
|
|
|
@ -221,10 +221,8 @@ class SAX2Tester < Test::Unit::TestCase
|
|||
def test_socket
|
||||
require 'socket'
|
||||
|
||||
port = 12345
|
||||
|
||||
server = TCPServer.new('127.0.0.1', port)
|
||||
socket = TCPSocket.new('127.0.0.1', port)
|
||||
server = TCPServer.new('127.0.0.1', 0)
|
||||
socket = TCPSocket.new('127.0.0.1', server.addr[1])
|
||||
|
||||
ok = false
|
||||
session = server.accept
|
||||
|
|
Loading…
Add table
Reference in a new issue