mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Test value types
This commit is contained in:
parent
8b5fd099bb
commit
35946dc993
3 changed files with 97 additions and 0 deletions
35
spec/spectator/value_spec.cr
Normal file
35
spec/spectator/value_spec.cr
Normal file
|
@ -0,0 +1,35 @@
|
|||
require "../spec_helper"
|
||||
|
||||
Spectator.describe Spectator::Value do
|
||||
subject { described_class.new(42, "Test Label") }
|
||||
|
||||
it "stores the value" do
|
||||
expect(&.value).to eq(42)
|
||||
end
|
||||
|
||||
# TODO: Fix issue with compile-time type of `subject` being a union.
|
||||
# describe "#to_s" do
|
||||
# subject { super.to_s }
|
||||
#
|
||||
# it "contains the label" do
|
||||
# is_expected.to contain("Test Label")
|
||||
# end
|
||||
#
|
||||
# it "contains the value" do
|
||||
# is_expected.to contain("42")
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# describe "#inspect" do
|
||||
# let(value) { described_class.new([42], "Test Label") }
|
||||
# subject { value.inspect }
|
||||
#
|
||||
# it "contains the label" do
|
||||
# is_expected.to contain("Test Label")
|
||||
# end
|
||||
#
|
||||
# it "contains the value" do
|
||||
# is_expected.to contain("[42]")
|
||||
# end
|
||||
# end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue