Sha256: 3e64259612fa04fb8b285f184c7dc1146844f43310e84ed68330312353590713

Contents?: true

Size: 491 Bytes

Versions: 2

Compression:

Stored size: 491 Bytes

Contents

require 'spec_helper'

describe Net::NTLM::EncodeUtil do

  context '#encode_utf16le' do
    it 'should convert an ASCII string to UTF' do
      expect(Net::NTLM::EncodeUtil.encode_utf16le('Test'.encode(::Encoding::ASCII_8BIT).freeze)).to eq("T\x00e\x00s\x00t\x00")
    end
  end

  context '#decode_utf16le' do
    it 'should convert a UTF string to ASCII' do
      expect(Net::NTLM::EncodeUtil.decode_utf16le("T\x00e\x00s\x00t\x00".freeze)).to eq('Test')
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rubyntlm-0.6.1/spec/lib/net/ntlm/encode_util_spec.rb
rubyntlm-0.6.1 spec/lib/net/ntlm/encode_util_spec.rb