test/unit/file/test_write.rb in facets-2.1.3 vs test/unit/file/test_write.rb in facets-2.2.0

- old
+ new

@@ -1,12 +1,6 @@ -# _____ _ -# |_ _|__ ___| |_ -# | |/ _ \/ __| __| -# | | __/\__ \ | -# |_|\___||___/\__| -# -# for facets/file/write.rb +# Test for facets/file/write.rb # TODO Needs a file mock. require 'facets/file/write.rb' require 'test/unit' @@ -41,11 +35,11 @@ # TODO This isn't right, and I'm concerned about acidentally writing a real file. # class TestFileWrite < Test::Unit::TestCase -# +# # class MockFile < ::File # def open( fname, mode, &blk ) # blk.call(self) # end # def ead( fname=nil ) @@ -56,27 +50,27 @@ # end # def <<( str ) # (@mock_content ||="") << str # end # end -# +# # File = MockFile.new -# +# # def test_create # f = "not a real file" # t = 'This is a test' # File.create( f, t ) # s = File.read( f ) # assert_equal( t, s ) # end -# +# # def test_rewrite # f = "not a real file" # t = 'This is a test' # File.write( t ) # File.rewrite(f) { |s| s.reverse! } # s = File.read(f) # assert_equal( t.reverse, s ) # end -# +# # end