Sha256: 8f6b6f278f68ac60eb4a63e4ad2e386bd12734a7b0dbd2dcf3cde9446b7f9da2

Contents?: true

Size: 1.09 KB

Versions: 144

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe Puppet::FileSystem::Uniquefile do
  describe "#open_tmp on Windows", :if => Puppet::Util::Platform.windows? do
    describe "with UTF8 characters" do
      include PuppetSpec::Files

      let(:rune_utf8) { "\u16A0\u16C7\u16BB\u16EB\u16D2\u16E6\u16A6\u16EB\u16A0\u16B1\u16A9\u16A0\u16A2\u16B1\u16EB\u16A0\u16C1\u16B1\u16AA\u16EB\u16B7\u16D6\u16BB\u16B9\u16E6\u16DA\u16B3\u16A2\u16D7" }
      let(:temp_rune_utf8) { tmpdir(rune_utf8) }

      it "should use UTF8 characters in TMP,TEMP,TMPDIR environment variable" do
        # Set the temporary environment variables to the UTF8 temp path
        Puppet::Util::Windows::Process.set_environment_variable('TMPDIR', temp_rune_utf8)
        Puppet::Util::Windows::Process.set_environment_variable('TMP', temp_rune_utf8)
        Puppet::Util::Windows::Process.set_environment_variable('TEMP', temp_rune_utf8)

        # Create a unique file
        filename = Puppet::FileSystem::Uniquefile.open_tmp('foo') do |file|
          File.dirname(file.path)
        end

        expect(filename).to eq(temp_rune_utf8)
      end
    end
  end
end

Version data entries

144 entries across 144 versions & 1 rubygems

Version Path
puppet-6.17.0 spec/integration/file_system/uniquefile_spec.rb
puppet-6.17.0-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.17.0-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.17.0-universal-darwin spec/integration/file_system/uniquefile_spec.rb
puppet-6.16.0 spec/integration/file_system/uniquefile_spec.rb
puppet-6.16.0-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.16.0-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.16.0-universal-darwin spec/integration/file_system/uniquefile_spec.rb
puppet-6.15.0 spec/integration/file_system/uniquefile_spec.rb
puppet-6.15.0-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.15.0-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.15.0-universal-darwin spec/integration/file_system/uniquefile_spec.rb
puppet-6.14.0 spec/integration/file_system/uniquefile_spec.rb
puppet-6.14.0-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.14.0-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.14.0-universal-darwin spec/integration/file_system/uniquefile_spec.rb
puppet-6.13.0 spec/integration/file_system/uniquefile_spec.rb
puppet-6.13.0-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.13.0-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-6.13.0-universal-darwin spec/integration/file_system/uniquefile_spec.rb