Use Box for Wrapper implementation

This won't raise on invalid casts.
It should reduce the amount of instantiated types and methods.
This commit is contained in:
Michael Miller 2022-03-19 22:48:55 -06:00
parent 18a03b02fe
commit e209fe3eb5
No known key found for this signature in database
GPG key ID: 32B47AE8F388A1FF
2 changed files with 4 additions and 32 deletions

View file

@ -10,9 +10,4 @@ Spectator.describe Spectator::Wrapper do
wrapper = described_class.new(Int32)
expect(wrapper.get { Int32 }).to eq(Int32)
end
it "raises on invalid cast" do
wrapper = described_class.new(42)
expect { wrapper.get(String) }.to raise_error(TypeCastError)
end
end