1 require File.dirname(__FILE__) + '/../spec_helper'
2 require File.dirname(__FILE__) + '/subtend_helper'
4 compile_extension('subtend_hash')
5 require File.dirname(__FILE__) + '/ext/subtend_hash'
7 describe "SubtendHash" do
12 it "rb_hash_new should return a new hash" do
13 @s.new_hash.should == {}
16 it "rb_hash_aref should return the value at the key" do
17 hsh = {:chunky => 'bacon'}
18 @s.access(hsh, :chunky).should == 'bacon'
21 it "rb_hash_aset should add the key/set pair and return the value" do
23 @s.insert(hsh, :chunky, 'bacon').should == 'bacon'
24 hsh.should == {:chunky => 'bacon'}
27 it "rb_hash_delete should remove the key and return the value" do
28 hsh = {:chunky => 'bacon'}
29 @s.remove(hsh, :chunky).should == 'bacon'