From 760691ca01f6785fa7c63a0a51dca04b82a2fc37 Mon Sep 17 00:00:00 2001 From: dblack Date: Tue, 2 Mar 2004 11:21:32 +0000 Subject: 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 --- test/scanf/test_scanfio.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'test/scanf/test_scanfio.rb') diff --git a/test/scanf/test_scanfio.rb b/test/scanf/test_scanfio.rb index 65989877d6..c8740aed43 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 + -- cgit v1.2.3