Sha256: 82c6ea798cf48aa52c0257551916e25fd3e4bf29ccf081722fe036b49081a925
Contents?: true
Size: 1021 Bytes
Versions: 32
Compression:
Stored size: 1021 Bytes
Contents
# frozen_string_literal: true, encoding: ASCII-8BIT require 'libcouchbase' describe Libcouchbase::Error do it "define the error classes" do expect(Libcouchbase::Error::MapChanged.new.is_a? StandardError).to be(true) end it "should be able to look up errors" do expect(Libcouchbase::Error::Lookup[:empty_key]).to be(Libcouchbase::Error::EmptyKey) expect(Libcouchbase::Error.lookup(:empty_key)).to be(Libcouchbase::Error::EmptyKey) expect(Libcouchbase::Error.lookup(:whatwhat_key)).to be(Libcouchbase::Error::UnknownError) expect(Libcouchbase::Error.lookup(2)).to be(Libcouchbase::Error::AuthError) expect(Libcouchbase::Error.lookup(-2)).to be(Libcouchbase::Error::UnknownError) end it "should be able to catch generic errors" do begin raise ::Libcouchbase::Error::NoMemory, 'what what' rescue ::Libcouchbase::Error => e expect(e.message).to eq('what what') end end end
Version data entries
32 entries across 32 versions & 2 rubygems