Sha256: 0601db7be1e37f124a524a4a7657edf32c5a85708883426076f6d01527b68c75

Contents?: true

Size: 801 Bytes

Versions: 1

Compression:

Stored size: 801 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

require 'dionysus/string'
describe String do
  it "should encode64s" do
    "abcde\240z405".encode64s.should == "YWJjZGWgejQwNQ=="
  end
  
  it "should encode64" do
    "abcde\240z405".encode64.should == "YWJjZGWgejQwNQ==\n"
  end
  
  it "should decode64" do
    "YWJjZGWgejQwNQ==".decode64.should == "abcde\240z405"
    "YWJjZGWgejQwNQ==\n".decode64.should == "abcde\240z405"
  end
  
  it "should encode_hex" do
    "abcde\240z405".encode_hex.should == "6162636465a07a343035"
    "abcde\240z405".encode_hexidecimal.should == "6162636465a07a343035"
  end
  
  it "should decode_hex" do
    '6162636465a07a343035'.decode_hex.should == "abcde\240z405"
    '6162636465a07a343035'.decode_hexidecimal.should == "abcde\240z405"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dionysus-0.2.1 spec/string_spec.rb