Sha256: 75e73e501d3dc5f54301e396c91288d736dc39b8222e83d656f719f024dd65c2

Contents?: true

Size: 716 Bytes

Versions: 23

Compression:

Stored size: 716 Bytes

Contents

require 'spec_helper'
describe Upsert do
  describe "supports binary upserts" do
    before do
      @fakes = []
      10.times do
        @fakes << [Faker::Name.name, Faker::Lorem.paragraphs(10).join("\n\n")]
      end
    end
    it "saves binary one by one" do
      @fakes.each do |name, biography|
        zipped_biography = Zlib::Deflate.deflate biography
        upsert = Upsert.new $conn, :pets
        assert_creates(Pet, [{:name => name, :zipped_biography => zipped_biography}]) do
          upsert.row({:name => name}, {:zipped_biography => Upsert.binary(zipped_biography)})
        end
        Zlib::Inflate.inflate(Pet.find_by_name(name).zipped_biography).should == biography
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
upsert-2.9.10-java spec/binary_spec.rb
upsert-2.9.10 spec/binary_spec.rb
upsert-2.9.9-universal-java-11 spec/binary_spec.rb
upsert-2.9.9 spec/binary_spec.rb
upsert-2.2.1 spec/binary_spec.rb
upsert-2.2.0 spec/binary_spec.rb
upsert-2.1.2 spec/binary_spec.rb
upsert-2.1.1 spec/binary_spec.rb
upsert-2.1.0 spec/binary_spec.rb
upsert-2.0.4 spec/binary_spec.rb
upsert-2.0.3 spec/binary_spec.rb
upsert-2.0.2 spec/binary_spec.rb
upsert-2.0.1 spec/binary_spec.rb
upsert-2.0.0 spec/binary_spec.rb
upsert-1.2.0 spec/binary_spec.rb
upsert-1.1.7 spec/binary_spec.rb
upsert-1.1.6 spec/binary_spec.rb
upsert-1.1.5 spec/binary_spec.rb
upsert-1.1.4 spec/binary_spec.rb
upsert-1.1.3 spec/binary_spec.rb