Sha256: f94a7af88742013e4da9795e8682c44ab87d73236e4df55ae89f2bd552481b75

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

require 'spec_helper'


describe CF::Data do
  subject {CF::Data.from_string('A CF string')}
  describe '#to_s' do
    it 'should return a binary ruby string' do
      ruby_string = subject.to_s
      ruby_string.should == 'A CF string'
      ruby_string.encoding.should == Encoding::ASCII_8BIT
    end
  end

  describe '#size' do
    it 'should return the size in bytes of the cfdata' do
      subject.size.should == 11
    end
  end

  describe 'to_ruby' do
    it 'should behave like to_s' do
      subject.to_ruby.should == 'A CF string'
      subject.to_ruby.encoding.should == Encoding::ASCII_8BIT
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
corefoundation-0.1.4 spec/data_spec.rb