require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe Suhyo::HashMatchers do include Suhyo::HashMatchers describe '#include_hash' do it 'matches if the target hash includes each pair in the expected hash' do {:a => 1, :b => 2, :c => 3, :d => 4}.should include_hash(:a => 1, :c => 3) end it 'does not match if the target hash is missing one of the pairs in the expected hash' do {:a => 1, :b => 2, :c => 3, :d => 4}.should_not include_hash(:a => 2, :c => 3) end end end