1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
########################################################################
# test_each.rb
#
# Test suite for the Pathname#each method.
########################################################################
require 'pathname2'
require 'test-unit'
class TC_Pathname_Each < Test::Unit::TestCase
def setup
@path = Pathname.new("C:/Users/foo/bar")
end
test "each basic functionality" do
assert_respond_to(@path, :each)
assert_nothing_raised{ @path.each{} }
end
test "each returns the expected results" do
arr = []
@path.each{ |e| arr << e }
assert_equal(['C:', 'Users', 'foo', 'bar'], arr)
end
def teardown
@path = nil
end
end
|