mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use cast as workaround
This commit is contained in:
parent
74b78b7ca8
commit
7d5c9edab7
1 changed files with 27 additions and 26 deletions
|
@ -4,32 +4,33 @@ Spectator.describe Spectator::Value do
|
|||
subject { described_class.new(42, "Test Label") }
|
||||
|
||||
it "stores the value" do
|
||||
expect(&.value).to eq(42)
|
||||
# NOTE: This cast is a workaround for [issue #55](https://gitlab.com/arctic-fox/spectator/-/issues/55)
|
||||
value = subject.as(Spectator::Value(Int32)).value
|
||||
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
|
||||
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…
Reference in a new issue