Sha256: b7d0c7ad5f0c5ba49184c50029c600f99c87ad4eb73e19fe68335025bede5d6e

Contents?: true

Size: 727 Bytes

Versions: 11

Compression:

Stored size: 727 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'
      if CF::String::HAS_ENCODING
        ruby_string.encoding.should == Encoding::ASCII_8BIT
      end
    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'
      if 'A CF string'.respond_to? "encoding"
        subject.to_ruby.encoding.should == Encoding::ASCII_8BIT
      end
    end
  end
end

Version data entries

11 entries across 8 versions & 3 rubygems

Version Path
og-corefoundation-0.2.3 spec/data_spec.rb
og-corefoundation-0.2.2 spec/data_spec.rb
og-corefoundation-0.2.1 spec/data_spec.rb
yakg-0.0.8 vendor/gems/ruby/1.8/gems/corefoundation-0.2.0/spec/data_spec.rb
yakg-0.0.8 vendor/gems/ruby/1.9.1/gems/corefoundation-0.2.0/spec/data_spec.rb
yakg-0.0.8 vendor/gems/ruby/2.0.0/gems/corefoundation-0.2.0/spec/data_spec.rb
yakg-0.0.6 vendor/gems/ruby/1.8/gems/corefoundation-0.2.0/spec/data_spec.rb
yakg-0.0.6 vendor/gems/ruby/1.9.1/gems/corefoundation-0.2.0/spec/data_spec.rb
yakg-0.0.4 vendor/gems/ruby/1.8/gems/corefoundation-0.2.0/spec/data_spec.rb
yakg-0.0.3 vendor/gems/ruby/1.8/gems/corefoundation-0.2.0/spec/data_spec.rb
corefoundation-0.2.0 spec/data_spec.rb