2015-01-15 08:16:14 +08:00
|
|
|
import plugins/fish-spec
|
|
|
|
|
2015-01-17 23:10:32 +08:00
|
|
|
function describe_expect_to_contain_all
|
2015-01-17 12:46:44 +08:00
|
|
|
function it_returns_0_when_lists_are_the_same
|
2015-01-21 08:10:39 +08:00
|
|
|
expect 1 2 --to-contain-all 1 2
|
2015-01-15 08:16:14 +08:00
|
|
|
|
2015-01-21 08:10:39 +08:00
|
|
|
expect $status --to-equal 0
|
2015-01-15 08:16:14 +08:00
|
|
|
end
|
|
|
|
|
2015-01-17 12:46:44 +08:00
|
|
|
function it_returns_1_when_lists_are_different
|
2015-01-21 08:10:39 +08:00
|
|
|
expect 1 2 --to-contain-all 8 9
|
2015-01-15 08:16:14 +08:00
|
|
|
|
2015-01-21 08:10:39 +08:00
|
|
|
expect $status --to-equal 1
|
2015-01-15 08:16:14 +08:00
|
|
|
end
|
|
|
|
|
2015-01-17 12:46:44 +08:00
|
|
|
function it_returns_0_when_lists_have_the_same_item_but_in_different_order
|
2015-01-21 08:10:39 +08:00
|
|
|
expect 1 2 --to-contain-all 2 1
|
2015-01-15 08:16:14 +08:00
|
|
|
|
2015-01-21 08:10:39 +08:00
|
|
|
expect $status --to-equal 0
|
2015-01-15 08:16:14 +08:00
|
|
|
end
|
|
|
|
|
2015-01-17 12:46:44 +08:00
|
|
|
function it_returns_0_when_expected_list_contains_the_item
|
2015-01-21 08:10:39 +08:00
|
|
|
expect 1 2 --to-contain-all 1
|
2015-01-15 08:16:14 +08:00
|
|
|
|
2015-01-21 08:10:39 +08:00
|
|
|
expect $status --to-equal 0
|
2015-01-15 08:16:14 +08:00
|
|
|
end
|
|
|
|
|
2015-01-17 12:46:44 +08:00
|
|
|
function it_returns_1_when_expected_list_does_not_contain_the_item
|
2015-01-21 08:10:39 +08:00
|
|
|
expect 1 2 --to-contain-all 9
|
2015-01-15 08:16:14 +08:00
|
|
|
|
2015-01-21 08:10:39 +08:00
|
|
|
expect $status --to-equal 1
|
2015-01-15 08:16:14 +08:00
|
|
|
end
|
|
|
|
|
2015-01-17 12:46:44 +08:00
|
|
|
function it_returns_0_when_expected_list_contains_all_items
|
2015-01-21 08:10:39 +08:00
|
|
|
expect 1 2 3 --to-contain-all 1 2
|
2015-01-15 08:16:14 +08:00
|
|
|
|
2015-01-21 08:10:39 +08:00
|
|
|
expect $status --to-equal 0
|
2015-01-15 08:16:14 +08:00
|
|
|
end
|
|
|
|
|
2015-01-17 12:46:44 +08:00
|
|
|
function it_returns_1_when_expected_list_does_not_contain_all_items
|
2015-01-21 08:10:39 +08:00
|
|
|
expect 1 2 3 --to-contain-all 1 2 9
|
2015-01-15 08:16:14 +08:00
|
|
|
|
2015-01-21 08:10:39 +08:00
|
|
|
expect $status --to-equal 1
|
2015-01-15 08:16:14 +08:00
|
|
|
end
|
|
|
|
|
2015-01-17 12:46:44 +08:00
|
|
|
function it_returns_1_when_expected_list_contains_less_items
|
2015-01-21 08:10:39 +08:00
|
|
|
expect 1 2 --to-contain-all 1 2 9
|
2015-01-15 08:16:14 +08:00
|
|
|
|
2015-01-21 08:10:39 +08:00
|
|
|
expect $status --to-equal 1
|
2015-01-15 08:16:14 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
spec.run $argv
|