base = File.dirname(__FILE__) require base + '/../test_setup' context 'S3 object' do setup do @s3_object_xml = File.open(File.join(base, '../files/s3_object.xml')).read @s3obj = S3Object.from_xml_string(@s3_object_xml) end specify 'can be initialised from XML fragment with correct data types' do @s3obj.key.should.equal '/home/ell/dir1/four.txt' d = @s3obj.last_modified [d.year, d.month, d.day, d.hour, d.min, d.sec].should.equal [2006, 8, 19, 22, 53, 29] @s3obj.etag.should.equal '24ce59274b89287b3960c184153ac24b' @s3obj.size.should.equal 14 end specify 'should treat the owner as an object in his/her own right' do [@s3obj.owner.user_id, @s3obj.owner.display_name].should.equal \ ['56efddfead5aa65da942f156fb2b294f44d78fd932d701331edc5fba19620fd4', 'elliotsmith3'] @s3obj.owner.should_be_instance_of S3ACL::CanonicalUser end specify 'can be associated with a NamedBucket' do todo end specify 'can be saved by proxing through the NamedBucket it is associated with' do todo end specify 'cannot be saved unless associated with a NamedBucket' do todo end end