shard-spectator/spec/spectator/wrapper_spec.cr
Michael Miller 419e7c1b8d
Use Box for Wrapper implementation
This won't raise on invalid casts.
It should reduce the amount of instantiated types and methods.
2022-03-19 23:00:32 -06:00

13 lines
326 B
Crystal

require "../spec_helper"
Spectator.describe Spectator::Wrapper do
it "stores a value" do
wrapper = described_class.new(42)
expect(wrapper.get(Int32)).to eq(42)
end
it "retrieves a value using the block trick" do
wrapper = described_class.new(Int32)
expect(wrapper.get { Int32 }).to eq(Int32)
end
end