class RSpec::Matchers::BeAnArrayOf::Matcher
Actual matcher
Public Instance Methods
failure_message()
click to toggle source
# File lib/rspec/matchers/be_an_array_of/matcher.rb, line 16 def failure_message <<-MSG.gsub(/^\s+/, " ") expected object to be an array#{" of " + type.name unless type.nil?} but it was #{actual} MSG end
match()
click to toggle source
# File lib/rspec/matchers/be_an_array_of/matcher.rb, line 10 def match return false unless actual.is_a? Array actual.map { |e| e.is_a? expected }.reduce(&:&) end