Sha256: 1de94d8b7383225614ca19a2e7c3e48885c81e10498161685de67a4b695b8e68
Contents?: true
Size: 1.04 KB
Versions: 9
Compression:
Stored size: 1.04 KB
Contents
require 'spec_helper' describe Stellar::Convert do subject{ Stellar::Convert } let(:raw) { "\x01\x02\x03\x04" } let(:hex) { "01020304" } let(:base64){ "AQIDBA==" } describe "hex encoding" do it "decodes" do expect(subject.from_hex(hex)).to eq(raw) end it "encodes" do expect(subject.to_hex(raw)).to eq(hex) end it "round trips" do raw1 = subject.from_hex(hex) hex1 = subject.to_hex(raw1) expect(hex1).to eq(hex) hex2 = subject.to_hex(raw) raw2 = subject.from_hex(hex2) expect(raw2).to eq(raw) end end describe "base64 encoding" do it "decodes" do expect(subject.from_base64(base64)).to eq(raw) end it "encodes" do expect(subject.to_base64(raw)).to eq(base64) end it "round trips" do raw1 = subject.from_base64(base64) base641 = subject.to_base64(raw1) expect(base641).to eq(base64) base642 = subject.to_base64(raw) raw2 = subject.from_base64(base642) expect(raw2).to eq(raw) end end end
Version data entries
9 entries across 9 versions & 1 rubygems