Sha256: 4c0caef5a1a2f96b4d58f3075e757f754da01f2d91489ff12e2fdb59d0359172
Contents?: true
Size: 752 Bytes
Versions: 18
Compression:
Stored size: 752 Bytes
Contents
# frozen_string_literal: true # encoding: utf-8 require 'lite_spec_helper' describe Mongo::Protocol::Registry do describe ".get" do context "when the type has a correspoding class" do before do described_class.register(Mongo::Protocol::Query::OP_CODE, Mongo::Protocol::Query) end let(:klass) do described_class.get(Mongo::Protocol::Query::OP_CODE, "message") end it "returns the class" do expect(klass).to eq(Mongo::Protocol::Query) end end context "when the type has no corresponding class" do it "raises an error" do expect { described_class.get(-100) }.to raise_error(Mongo::Error::UnsupportedMessageType) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems