There are many ways to verify the same thing:
a = ["hello", "goodbye"] b = ["hello", "goodbye", "orange"] (a - b).empty? # => true a.all?{|i| b.include? i } # => true a = ["hello", "welcome"] b = ["hello", "goodbye", "orange"] (a - b).empty? # => false a.all?{|i| b.include? i } # => false
source share