mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add spec for TypedValueWrapper
This commit is contained in:
parent
c711115023
commit
dbcf9ec57d
1 changed files with 18 additions and 0 deletions
18
spec/internals/typed_value_wrapper_spec.cr
Normal file
18
spec/internals/typed_value_wrapper_spec.cr
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
require "../spec_helper"
|
||||||
|
|
||||||
|
describe Spectator::Internals::TypedValueWrapper do
|
||||||
|
describe "#value" do
|
||||||
|
it "returns the expected value" do
|
||||||
|
value = 12345
|
||||||
|
wrapper = Spectator::Internals::TypedValueWrapper.new(value)
|
||||||
|
wrapper.value.should eq(value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it "can be cast for storage" do
|
||||||
|
value = 12345
|
||||||
|
wrapper = Spectator::Internals::TypedValueWrapper.new(value).as(Spectator::Internals::ValueWrapper)
|
||||||
|
typed = wrapper.as(Spectator::Internals::TypedValueWrapper(typeof(value)))
|
||||||
|
typed.value.should eq(value)
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue