Sha256: b85ac232b43859fe7fac5b63f9fdbe20170adc0df4d6d217f1b0bcd2acf8b778
Contents?: true
Size: 703 Bytes
Versions: 15
Compression:
Stored size: 703 Bytes
Contents
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
15 entries across 15 versions & 1 rubygems