mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Test values returned by match data
This commit is contained in:
parent
bb3f2d5338
commit
ec06daaf35
2 changed files with 43 additions and 0 deletions
|
@ -69,6 +69,28 @@ describe Spectator::Matchers::EqualityMatcher do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#values" do
|
||||||
|
context "expected" do
|
||||||
|
it "is the expected value" do
|
||||||
|
expected, actual = 42, 777
|
||||||
|
partial = new_partial(actual)
|
||||||
|
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
|
||||||
|
match_data = matcher.match(partial)
|
||||||
|
match_data.values[:expected].should eq(expected)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context "actual" do
|
||||||
|
it "is the actual value" do
|
||||||
|
expected, actual = 42, 777
|
||||||
|
partial = new_partial(actual)
|
||||||
|
matcher = Spectator::Matchers::EqualityMatcher.new(expected)
|
||||||
|
match_data = matcher.match(partial)
|
||||||
|
match_data.values[:actual].should eq(actual)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#message" do
|
describe "#message" do
|
||||||
it "mentions ==" do
|
it "mentions ==" do
|
||||||
value = 42
|
value = 42
|
||||||
|
|
|
@ -25,6 +25,27 @@ describe Spectator::Matchers::NilMatcher do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#values" do
|
||||||
|
context "expected" do
|
||||||
|
it "is nil" do
|
||||||
|
partial = new_partial(42)
|
||||||
|
matcher = Spectator::Matchers::NilMatcher.new
|
||||||
|
match_data = matcher.match(partial)
|
||||||
|
match_data.values[:expected].should eq(nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context "actual" do
|
||||||
|
it "is the actual value" do
|
||||||
|
value = 42
|
||||||
|
partial = new_partial(value)
|
||||||
|
matcher = Spectator::Matchers::NilMatcher.new
|
||||||
|
match_data = matcher.match(partial)
|
||||||
|
match_data.values[:actual].should eq(value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#message" do
|
describe "#message" do
|
||||||
it "mentions nil" do
|
it "mentions nil" do
|
||||||
partial = new_partial(42)
|
partial = new_partial(42)
|
||||||
|
|
Loading…
Reference in a new issue