Sha256: ee35ebcbdb1e18239d4895704298214aff8fa900241182cede0e57a7002f1d5f

Contents?: true

Size: 1.19 KB

Versions: 11

Compression:

Stored size: 1.19 KB

Contents

require 'rubygems'              # for 1.8

RSpec.configure do |config|
  config.expect_with :rspec do |c|
    c.syntax = [:should, :expect]
  end
  config.mock_with :rspec do |c|
    c.syntax = [:should, :expect]
  end
end


class String
  if ''.respond_to? :encode
    def encode_as_utf8
      encode(Encoding::UTF_8)
    end
    def force_as_utf8
      force_encoding(Encoding::UTF_8)
    end
    unless String.instance_methods.include?(:b)
      def b
        dup.force_encoding(Encoding::BINARY)
      end
    end
  else
    def encode_as_utf8
      self                      # MRI 1.8
    end
    def force_as_utf8
      self                      # MRI 1.8
    end
    def b
      self
    end
  end
  unless ''.respond_to? :clear
    def clear
      replace('')
    end
  end
  def hexbytes(sep = '')
    bytes.map{|x| "%02x" % x}.join(sep)
  end
end

if ENV['SIMPLE_COV']
  require 'simplecov'
  SimpleCov.start do
    add_filter 'spec/'
    add_filter 'pkg/'
    add_filter 'vendor/'
  end
end

if ENV['GC_STRESS']
  puts "enable GC.stress"
  GC.stress = true
end

require 'cbor'

MessagePack = CBOR              # XXX

Packer = MessagePack::Packer
Unpacker = MessagePack::Unpacker
Buffer = MessagePack::Buffer

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
hx_cbor-2024.7.7 spec/spec_helper.rb
cbor-0.5.9.8 spec/spec_helper.rb
cbor-0.5.9.7 spec/spec_helper.rb
hx_cbor-2021.8.20 spec/spec_helper.rb
cbor-0.5.9.6 spec/spec_helper.rb
cbor-0.5.9.5 spec/spec_helper.rb
cbor-0.5.9.4 spec/spec_helper.rb
cbor-0.5.9.3 spec/spec_helper.rb
cbor-0.5.9.2 spec/spec_helper.rb
cbor-0.5.9.1 spec/spec_helper.rb
cbor-0.5.9.0 spec/spec_helper.rb