blob: 7a55e90f8e318ce01a8d109cc8a6f1dd58a5f7a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
require 'spec_helper'
require 'matchers/include'
describe "include matchers" do
include Matchers::Include
context :include_in_any_order do
it "matches an empty list" do
expect([]).to include_in_any_order()
end
it "matches a list with a single element" do
expect([1]).to include_in_any_order(eq(1))
end
it "does not match when an expected element is missing" do
expect([1]).to_not include_in_any_order(eq(2))
end
it "matches a list with 2 elements in a different order from the expectation" do
expect([1, 2]).to include_in_any_order(eq(2), eq(1))
end
it "does not match when there are more than just the expected elements" do
expect([1, 2]).to_not include_in_any_order(eq(1))
end
it "matches multiple, equal elements when there are multiple, equal exepectations" do
expect([1, 1]).to include_in_any_order(eq(1), eq(1))
end
end
end
|