diff options
author | dblack <dblack@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-02 11:21:32 +0000 |
---|---|---|
committer | dblack <dblack@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-02 11:21:32 +0000 |
commit | 7150dfb3224d43de26f039e0621db564b82ee6f4 (patch) | |
tree | 01110ddab32c8b0cc54c70039ed3465651cc88e5 /test/scanf/test_scanfio.rb | |
parent | 0d2e1b5ed39a8692e0ae63bc3190cb452d6b2615 (diff) | |
download | ruby-7150dfb3224d43de26f039e0621db564b82ee6f4.tar.gz ruby-7150dfb3224d43de26f039e0621db564b82ee6f4.tar.xz ruby-7150dfb3224d43de26f039e0621db564b82ee6f4.zip |
Fixed to work with Ruby test suite (patch from Nobu)
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/scanf/test_scanfio.rb')
-rw-r--r-- | test/scanf/test_scanfio.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/scanf/test_scanfio.rb b/test/scanf/test_scanfio.rb index 65989877d..c8740aed4 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 + |