require File.dirname(__FILE__) + '/spec_helper' describe "hash extentions" do it "limit_to_keys should limit keys in hash" do h = {:bro1=>'me',:bro2=>'rob',:bro3=>'eric'} h.limit_to_keys([:bro1,:bro2]).should == {:bro1=>'me',:bro2=>'rob'} h.should == {:bro1=>'me',:bro2=>'rob',:bro3=>'eric'} end it "limit_to_keys! should destructively limit keys in hash" do h = {:bro1=>'me',:bro2=>'rob',:bro3=>'eric'} h.limit_to_keys!([:bro1,:bro2]).should == {:bro1=>'me',:bro2=>'rob'} h.should == {:bro1=>'me',:bro2=>'rob'} end it "soft deletes" do h = {:dan=>1,:eric=>2} h.soft_delete(:dan).should == {:eric=>2} end end