shogi-server source
Révision | d3ed2b0e9930dcb84217090d51f93fc5075e098d (tree) |
---|---|
l'heure | 2011-12-04 14:30:05 |
Auteur | Daigo Moriwaki <beatles@user...> |
Commiter | Daigo Moriwaki |
Explicit file encoding.
@@ -1,9 +1,11 @@ | ||
1 | -require "baseclient" | |
1 | +$:.unshift File.join(File.dirname(__FILE__), "..") | |
2 | +$topdir = File.expand_path File.dirname(__FILE__) | |
3 | +require "test/baseclient" | |
2 | 4 | include Socket::Constants |
3 | 5 | |
4 | 6 | class UchifuzumeTest < ReadFileClient |
5 | 7 | def test_uchifuzume |
6 | - csa = File.open(filepath("uchifuzume.csa")) {|f| f.read} | |
8 | + csa = File.read(filepath("uchifuzume.csa"), :encoding => Encoding::Shift_JIS) | |
7 | 9 | handshake(csa) |
8 | 10 | @p2.puts "-0064FU" |
9 | 11 | @p1.puts "%TORYO" |
@@ -14,7 +16,7 @@ class UchifuzumeTest < ReadFileClient | ||
14 | 16 | end |
15 | 17 | |
16 | 18 | def test_not_uchifuzume |
17 | - csa = File.open(filepath("not_uchifuzume.csa")) {|f| f.read} | |
19 | + csa = File.read(filepath("not_uchifuzume.csa"), :encoding => Encoding::Shift_JIS) | |
18 | 20 | handshake(csa) |
19 | 21 | @p2.puts "-0092FU" |
20 | 22 | @p1.puts "%TORYO" |