Sha256: fb7ec11af1c1f7a45efa9e590e735d7eea0170dc5de7c0a48b7ef0f5e413541b

Contents?: true

Size: 665 Bytes

Versions: 2

Compression:

Stored size: 665 Bytes

Contents

require 'ronin/formatting/binary'

require 'spec_helper'

describe String do
  before(:all) do
    @packed_integer = ""
  end

  it "should provide String#depack" do
    @packed_integer.respond_to?('depack').should == true
  end

  describe "xor" do
    before(:all) do
      @string = 'hello'
      @key = 0x50
    end

    it "should not contain the key used in the xor" do
      @string.include?(@key).should_not == true
    end

    it "should not equal the original string" do
      @string.xor(@key).should_not == @string
    end

    it "should be able to be decoded with another xor" do
      @string.xor(@key).xor(@key).should == @string
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ronin-0.1.3 spec/formatting/binary/string_spec.rb
ronin-0.1.4 spec/formatting/binary/string_spec.rb