Sha256: 010d95f3db58ce9d76aece9714982568192d256eaaefae449cd432f34b4c5399
Contents?: true
Size: 510 Bytes
Versions: 10
Compression:
Stored size: 510 Bytes
Contents
module Riot # Asserts that two arrays contain the same elements, the same number of times. # asserts("test") { ["foo", "bar"] }.same_elements(["bar", "foo"]) # should("test") { ["foo", "bar"] }.same_elements(["bar", "foo"]) class SameElementsMacro < AssertionMacro register :same_elements def evaluate(actual, expected) require 'set' same = (Set.new(expected) == Set.new(actual)) same ? pass : fail(expected_message.elements(expected).to_match(actual)) end end end
Version data entries
10 entries across 10 versions & 1 rubygems