mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add RSpec contain_exactly
matcher spec
This commit is contained in:
parent
034c1cd6cb
commit
5bbaad36d2
1 changed files with 32 additions and 0 deletions
32
spec/rspec/expectations/contain_exactly_matcher_spec.cr
Normal file
32
spec/rspec/expectations/contain_exactly_matcher_spec.cr
Normal file
|
@ -0,0 +1,32 @@
|
|||
require "../../spec_helper"
|
||||
|
||||
# Examples taken from:
|
||||
# https://relishapp.com/rspec/rspec-expectations/v/3-8/docs/built-in-matchers/contain-exactly-matcher
|
||||
# and modified to fit Spectator and Crystal.
|
||||
Spectator.describe "`contain_exactly` matcher" do
|
||||
context "Array is expected to contain every value" do
|
||||
describe [1, 2, 3] do
|
||||
it { is_expected.to contain_exactly(1, 2, 3) }
|
||||
it { is_expected.to contain_exactly(1, 3, 2) }
|
||||
it { is_expected.to contain_exactly(2, 1, 3) }
|
||||
it { is_expected.to contain_exactly(2, 3, 1) }
|
||||
it { is_expected.to contain_exactly(3, 1, 2) }
|
||||
it { is_expected.to contain_exactly(3, 2, 1) }
|
||||
|
||||
# deliberate failures
|
||||
# TODO: Add support for expected failures.
|
||||
xit { is_expected.to contain_exactly(1, 2, 1) }
|
||||
end
|
||||
end
|
||||
|
||||
context "Array is not expected to contain every value" do
|
||||
describe [1, 2, 3] do
|
||||
it { is_expected.to_not contain_exactly(1, 2, 3, 4) }
|
||||
it { is_expected.to_not contain_exactly(1, 2) }
|
||||
|
||||
# deliberate failures
|
||||
# TODO: Add support for expected failures.
|
||||
xit { is_expected.to_not contain_exactly(1, 3, 2) }
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue