Sha256: 0300fddc7db853716ec4047040f96717928a5d9508b2c38b06922e9dd084c89f

Contents?: true

Size: 1.12 KB

Versions: 240

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe Puppet::FileSystem::Uniquefile do

  describe "#open_tmp on Windows", :if => Puppet.features.microsoft_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

240 entries across 240 versions & 1 rubygems

Version Path
puppet-5.5.2 spec/integration/file_system/uniquefile_spec.rb
puppet-5.5.2-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-5.5.2-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-5.5.2-universal-darwin spec/integration/file_system/uniquefile_spec.rb
puppet-5.3.7 spec/integration/file_system/uniquefile_spec.rb
puppet-5.3.7-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-5.3.7-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-5.3.7-universal-darwin spec/integration/file_system/uniquefile_spec.rb
puppet-4.10.12 spec/integration/file_system/uniquefile_spec.rb
puppet-4.10.12-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-4.10.12-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-4.10.12-universal-darwin spec/integration/file_system/uniquefile_spec.rb
puppet-5.5.1 spec/integration/file_system/uniquefile_spec.rb
puppet-5.5.1-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-5.5.1-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-5.5.1-universal-darwin spec/integration/file_system/uniquefile_spec.rb
puppet-4.10.11 spec/integration/file_system/uniquefile_spec.rb
puppet-4.10.11-x86-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-4.10.11-x64-mingw32 spec/integration/file_system/uniquefile_spec.rb
puppet-4.10.11-universal-darwin spec/integration/file_system/uniquefile_spec.rb