Sha256: 996e2ed7e6cb1e4c5f803a04d39b75f66c707d6b0165b2d1b671513cef9f6b76
Contents?: true
Size: 637 Bytes
Versions: 5
Compression:
Stored size: 637 Bytes
Contents
covers 'facets/file/rewrite' test_case File do test_data = 'This is a test!' class_method :rewrite do setup do @test_file = 'tmp/rewrite.txt' File.open(@test_file, 'w'){ |w| w << test_data } end test do File.rewrite(@test_file){ |s| s.reverse } File.read(@test_file).assert == test_data.reverse end end class_method :rewrite! do setup do @test_file = 'tmp/rewrite.txt' File.open(@test_file, 'w'){ |w| w << test_data } end test do File.rewrite!(@test_file){ |s| s.reverse! } File.read(@test_file).assert == test_data.reverse end end end
Version data entries
5 entries across 5 versions & 2 rubygems