Sha256: 7b7dcb578beaa0efe5d4c89f6d7a6c03186d18f2ed45bc3d5ee065a27a035cae
Contents?: true
Size: 986 Bytes
Versions: 17
Compression:
Stored size: 986 Bytes
Contents
require 'spec_helper' describe RSpecCandy do describe 'matchers' do describe 'include_hash' do it 'should match if all pairs in the given hash exist in the receiver' do { :foo => 'a', :bar => 'b' , :bam => 'c'}.should include_hash(:foo => 'a', :bam => 'c') end it 'should not match if the given hash has keys that do not exist in the receiver' do { :foo => 'a', :bar => 'b' , :bam => 'c'}.should_not include_hash(:foo => 'a', :baz => 'd') end it 'should not match if the given hash has values that are different in the receiver' do { :foo => 'a', :bar => 'b' , :bam => 'c'}.should_not include_hash(:foo => 'a', :bam => 'different-value') end it 'should not crash and not match if the receiver is nil' do nil.should_not include_hash(:foo => 'a') end it 'should match if the receiver is empty and the given hash is empty' do {}.should include_hash({}) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems