Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ac407f0b72
Fetching contributors…

Cannot retrieve contributors at this time

file 26 lines (21 sloc) 0.558 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
require 'rspec'
require 'libsnappy'

describe Snappy do
  it 'should compress data' do
    lambda do
      Snappy.compress('abcdefg')
    end.should_not raise_error
  end

  it 'should uncompress data' do
    lambda do
      Snappy.uncompress(Snappy.compress('abcdefg'))
    end.should_not raise_error
  end

  it 'should roundtrip the data' do
    original = 'abcdefg' * 100

    compressed = Snappy.compress(original)
    uncompressed = Snappy.uncompress(compressed)

    original.should == uncompressed
    compressed.size.should < original.size
  end
end
Something went wrong with that request. Please try again.