Skip to content

Instantly share code, notes, and snippets.

@brianjlandau
Created August 24, 2015 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjlandau/7e9b98d0fe0b6813adb4 to your computer and use it in GitHub Desktop.
Save brianjlandau/7e9b98d0fe0b6813adb4 to your computer and use it in GitHub Desktop.
RSpec::Matchers.define :be_an_array_of do |expected|
match do |actual|
actual.is_a?(Array) && actual.all?{|item| item.is_a?(expected) }
end
failure_message do |actual|
"expected that #{actual} would be an array #{expected}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment