mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add tests for match data values
This commit is contained in:
parent
cdef7f9fa3
commit
1db5341f4b
1 changed files with 24 additions and 0 deletions
|
@ -91,6 +91,30 @@ describe Spectator::Matchers::CaseMatcher do
|
|||
end
|
||||
end
|
||||
|
||||
describe "#values" do
|
||||
context "expected" do
|
||||
it "is the expected value" do
|
||||
actual = "foobar"
|
||||
expected = /foo/
|
||||
partial = new_partial(actual)
|
||||
matcher = Spectator::Matchers::CaseMatcher.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
|
||||
actual = "foobar"
|
||||
expected = /foo/
|
||||
partial = new_partial(actual)
|
||||
matcher = Spectator::Matchers::CaseMatcher.new(expected)
|
||||
match_data = matcher.match(partial)
|
||||
match_data.values[:actual].should eq(actual)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#message" do
|
||||
it "mentions ===" do
|
||||
value = 42
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue