test/tc/copy-from.rb in rio-0.3.3 vs test/tc/copy-from.rb in rio-0.3.4
- old
+ new
@@ -41,22 +41,22 @@
def test_string_file
ario = rio('ous').delete!.puts!("If you are seeing this, rio < string is broken")
str = "HelloWorld\n"
ario < str
assert(ario.closed?,"Rio closes after copy-from string")
- assert_equal(str,ario.slurp)
+ assert_equal(str,ario.contents)
ario << str
- assert_equal(str+str,ario.slurp)
+ assert_equal(str+str,ario.contents)
end
def test_arrayofstrings_file
ario = rio('oua').delete!.puts!("If you are seeing this, rio < array is broken")
str = "HelloWorld\n"
ario < [str]
- assert_equal(str,ario.slurp)
+ assert_equal(str,ario.contents)
ario << [str]
- assert_equal(str+str,ario.slurp)
+ assert_equal(str+str,ario.contents)
end
def test_string_dir
ario = rio('oud').delete!.mkdir
@@ -83,19 +83,19 @@
def test_string_nonex
ario = rio('oun').delete!
str = "HelloWorld\n"
ario < str
assert(ario.file?,"Copy from string creates a file")
- assert_equal(str,ario.slurp)
+ assert_equal(str,ario.contents)
end
def test_arrayofstrings_nonex
ario = rio('oun').delete!
str = "HelloWorld\n"
ario < [str]
assert(ario.file?,"Copy from array of strings creates a file")
- assert_equal(str,ario.slurp)
+ assert_equal(str,ario.contents)
end
def test_simple_rio0
cptest(rio(@d0))
end
@@ -127,54 +127,54 @@
def test_uri_rio_to_file
ario = rio('out').delete!.touch
url = 'http://localhost/rio/hw.html'
urio = rio(url)
ario < urio
- exp = urio.slurp
- assert_equal(exp,ario.slurp)
+ exp = urio.contents
+ assert_equal(exp,ario.contents)
end
def test_uri_rio_to_dir
ario = rio('ud').delete!.mkdir
url = 'http://localhost/rio/hw.html'
urio = rio(url)
#$trace_states = true
ario < urio
$trace_states = false
drio = rio(ario,urio.filename)
assert(drio.file?)
- assert(urio.slurp,drio.slurp)
+ assert(urio.contents,drio.contents)
end
def test_uri_string_to_dir
ario = rio('uds').delete!.mkdir
url = 'http://localhost/rio/hw.html'
urio = rio(url)
#$trace_states = true
ario < url
$trace_states = false
drio = rio(ario,urio.filename)
assert(drio.file?)
- assert(urio.slurp,drio.slurp)
+ assert(urio.contents,drio.contents)
end
def test_url_string_to_file
ario = rio('out').delete!.touch
url = 'http://localhost/rio/hw.html'
ario < url
exp = url
- assert_equal(exp,ario.slurp)
+ assert_equal(exp,ario.contents)
end
def test_url_array_to_file
ario = rio('out').delete!.touch
url = 'http://localhost/rio/hw.html'
ario < [url]
exp = url
- assert_equal(exp,ario.slurp)
+ assert_equal(exp,ario.contents)
end
def test_url_string_to_nonex
ario = rio('outz').delete!
url = 'http://localhost/rio/hw.html'
ario < url
exp = url
- assert_equal(exp,ario.slurp)
+ assert_equal(exp,ario.contents)
end
def test_simple_ary
dst = rio('dst').delete!.mkpath
dst < @d0[]
assert_rios_equal(@d0,dst,"simple rio copy")