Sha256: b6a36be9029b77a442682ec49fa0cdd83744996db29db192186b949727e919bd

Contents?: true

Size: 594 Bytes

Versions: 11

Compression:

Stored size: 594 Bytes

Contents

require 'facets/file/write'
require 'test/unit'
require 'tempfile'

class TC_File_Writelines < Test::Unit::TestCase

  def setup
    tmp_dir = Dir::tmpdir # ENV["TMP"] || ENV["TEMP"] || "/tmp"
    raise "Can't find temporary directory" unless File.directory?(tmp_dir)
    @path = File.join(tmp_dir, "ruby_io_test")
  end

  # Test File.writelines
  def test_file_writelines
    data_in = %w[one two three four five]
    File.writelines(@path, data_in)
    data_out = File.readlines(@path)     # This is standard class method.
    assert_equal(data_in, data_out.map { |l| l.chomp })
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/file/test_writelines.rb
facets-2.8.3 test/core/file/test_writelines.rb
facets-2.8.2 test/core/file/test_writelines.rb
facets-2.8.1 test/core/file/test_writelines.rb
facets-2.8.0 test/core/file/test_writelines.rb
facets-2.7.0 test/core/file/test_writelines.rb
facets-2.6.0 test/core/file/test_writelines.rb
facets-2.5.0 test/core/file/test_writelines.rb
facets-2.5.1 test/core/file/test_writelines.rb
facets-2.4.5 test/core/file/test_writelines.rb
facets-2.5.2 test/core/file/test_writelines.rb