Sha256: 1a38a6a36a7e209a8c91ee41f5a13f638eb2e0ea5bc54a20b1ebb913b02a566b

Contents?: true

Size: 626 Bytes

Versions: 9

Compression:

Stored size: 626 Bytes

Contents

require_relative 'test_helper'

class UtilsTest < Minitest::Test
  describe IOStreams::Utils do
    describe '.temp_file_name' do
      it 'returns value from block' do
        result = IOStreams::Utils.temp_file_name('base', '.ext') { |_name| 257 }
        assert_equal 257, result
      end

      it 'supplies new temp file_name' do
        file_name  = nil
        file_name2 = nil
        IOStreams::Utils.temp_file_name('base', '.ext') { |name| file_name = name }
        IOStreams::Utils.temp_file_name('base', '.ext') { |name| file_name2 = name }
        refute_equal file_name, file_name2
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
iostreams-1.1.0 test/utils_test.rb
iostreams-1.0.0 test/utils_test.rb
iostreams-1.0.0.beta7 test/utils_test.rb
iostreams-1.0.0.beta6 test/utils_test.rb
iostreams-1.0.0.beta5 test/utils_test.rb
iostreams-1.0.0.beta4 test/utils_test.rb
iostreams-1.0.0.beta3 test/utils_test.rb
iostreams-1.0.0.beta2 test/utils_test.rb
iostreams-1.0.0.beta test/utils_test.rb