summaryrefslogtreecommitdiff
path: root/test/scanf/test_scanfio.rb
diff options
context:
space:
mode:
authordblack <dblack@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-02 11:21:32 +0000
committerdblack <dblack@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-02 11:21:32 +0000
commit760691ca01f6785fa7c63a0a51dca04b82a2fc37 (patch)
tree01110ddab32c8b0cc54c70039ed3465651cc88e5 /test/scanf/test_scanfio.rb
parent5aad8206044f98b28bc303d5bd7d3e4f935e96ec (diff)
Fixed to work with Ruby test suite (patch from Nobu)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/scanf/test_scanfio.rb')
-rw-r--r--test/scanf/test_scanfio.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/test/scanf/test_scanfio.rb b/test/scanf/test_scanfio.rb
index 65989877d69..c8740aed434 100644
--- a/test/scanf/test_scanfio.rb
+++ b/test/scanf/test_scanfio.rb
@@ -5,11 +5,15 @@
# Ad hoc tests of IO#scanf (needs to be expanded)
-$:.unshift("..")
-require "scanf.rb"
-
-fh = File.new("data.txt", "r")
-p fh.pos
-p fh.scanf("%s%s")
-p fh.scanf("%da fun%s")
-p fh.pos
+require "scanf"
+
+class TestScanfIO
+ def test_io
+ fh = File.new(File.join(File.dirname(__FILE__), "data.txt"), "r")
+ assert_equal(0, fh.pos)
+ assert_equal(["this", "is"], fh.scanf("%s%s"))
+ assert_equal([33, "littel"], fh.scanf("%da fun%s"))
+ #p fh.pos
+ end
+end
+