File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 44
55module Kafka
66 module Compression
7+ def self . codecs
8+ [ :snappy , :gzip , :lz4 ]
9+ end
10+
711 def self . find_codec ( name )
812 case name
913 when nil then nil
1014 when :snappy then SnappyCodec . new
1115 when :gzip then GzipCodec . new
12- when :lz4 then LZ4Codec . new
16+ when :lz4 then LZ4Codec . new
1317 else raise "Unknown compression codec #{ name } "
1418 end
1519 end
Original file line number Diff line number Diff line change 1+ describe Kafka ::Compression do
2+ Kafka ::Compression . codecs . each do |codec_name |
3+ describe codec_name . to_s do
4+ it "encodes and decodes data" do
5+ data = "yolo"
6+ codec = Kafka ::Compression . find_codec ( codec_name )
7+
8+ expect ( codec . decompress ( codec . compress ( data ) ) ) . to eq data
9+ end
10+ end
11+ end
12+ end
You can’t perform that action at this time.
0 commit comments