Skip to content

Instantly share code, notes, and snippets.

@carols10cents
Created October 2, 2010 18:25
Show Gist options
  • Save carols10cents/607861 to your computer and use it in GitHub Desktop.
Save carols10cents/607861 to your computer and use it in GitHub Desktop.
require 'roster'
describe "roster" do
before(:each) do
@r = Roster.new
@r << "Gregory Brown"
end
it "should update cache the first time" do
before_obj_id = @r.object_id
@r.to_xml
@r.object_id.should_not eql(before_obj_id)
end
it "should cache if not modified between 1st and 2nd to_xml" do
@r.to_xml
before_obj_id = @r.object_id
@r.to_xml
@r.object_id.should eql(before_obj_id)
end
it "should update cache if modified between 1st and 2nd to_xml" do
@r.to_xml
@r << "David Black"
before_obj_id = @r.object_id
@r.to_xml
@r.object_id.should_not eql(before_obj_id)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment