Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use test_str variable in test

  • Loading branch information...
commit 749219c25bec4f317dc546aec530fc1ae7465f44 1 parent bbf3e49
@take-cheeze take-cheeze authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 test/uv.rb
View
8 test/uv.rb
@@ -46,14 +46,15 @@ def remove_uv_test_tmpfile
end
assert_uv('UV::FS') do
+ test_str = 'helloworld'
remove_uv_test_tmpfile
UV::FS::mkdir("foo-bar") do
f = UV::FS::open("foo-bar/foo.txt", UV::FS::O_CREAT|UV::FS::O_WRONLY, UV::FS::S_IWRITE | UV::FS::S_IREAD)
- f.write("helloworld") do
+ f.write(test_str) do
f.close do
f = UV::FS::open("foo-bar/foo.txt", UV::FS::O_RDONLY, UV::FS::S_IREAD) do
assert_equal 'hello', f.read(5)
- assert_equal 'helloworld', f.read()
+ assert_equal test_str, f.read()
f.close { remove_uv_test_tmpfile }
end
end
@@ -159,10 +160,11 @@ def remove_uv_test_tmpfile
end
assert_uv('UV::FS::readdir') do
+ test_str = 'helloworld'
remove_uv_test_tmpfile
UV::FS::mkdir("foo-bar") do
f = UV::FS::open("foo-bar/foo.txt", UV::FS::O_CREAT|UV::FS::O_WRONLY, UV::FS::S_IWRITE | UV::FS::S_IREAD)
- f.write("helloworld") do
+ f.write(test_str) do
UV::FS::readdir("foo-bar", 0) do |x,a|
assert_equal ['foo.txt'], a
remove_uv_test_tmpfile
Please sign in to comment.
Something went wrong with that request. Please try again.