Permalink
Browse files

use test_str variable in test

  • Loading branch information...
1 parent bbf3e49 commit 749219c25bec4f317dc546aec530fc1ae7465f44 @take-cheeze take-cheeze committed Mar 8, 2014
Showing with 5 additions and 3 deletions.
  1. +5 −3 test/uv.rb
View
@@ -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

0 comments on commit 749219c

Please sign in to comment.