1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

add identity setter and fix more deprecated directory calls

This commit is contained in:
geemus 2010-05-03 16:48:46 -07:00
parent c07a5d343d
commit 01c2a29a49
2 changed files with 10 additions and 6 deletions

View file

@ -51,6 +51,10 @@ module Fog
send(self.class.instance_variable_get('@identity'))
end
def identity=(new_identity)
send("#{identity}=", new_identity)
end
def initialize(new_attributes = {})
merge_attributes(new_attributes)
end

View file

@ -5,8 +5,8 @@ describe 'Fog::AWS::S3::Directories' do
describe "#all" do
it "should include persisted directories" do
@directory = AWS[:s3].directories.create(:name => 'fogdirectoryname')
AWS[:s3].directories.all.map {|directory| @directory.name}.should include('fogdirectoryname')
@directory = AWS[:s3].directories.create(:key => 'fogdirectorykey')
AWS[:s3].directories.all.map {|directory| @directory.key}.should include('fogdirectorykey')
@directory.destroy
end
@ -15,8 +15,8 @@ describe 'Fog::AWS::S3::Directories' do
describe "#create" do
it "should exist on s3" do
directory = AWS[:s3].directories.create(:name => 'fogdirectoryname')
AWS[:s3].directories.get(directory.name).should_not be_nil
directory = AWS[:s3].directories.create(:key => 'fogdirectorykey')
AWS[:s3].directories.get(directory.key).should_not be_nil
directory.destroy
end
@ -25,8 +25,8 @@ describe 'Fog::AWS::S3::Directories' do
describe "#get" do
it "should return a Fog::AWS::S3::Directory if a matching directory exists" do
directory = AWS[:s3].directories.create(:name => 'fogdirectoryname')
get = AWS[:s3].directories.get('fogdirectoryname')
directory = AWS[:s3].directories.create(:key => 'fogdirectorykey')
get = AWS[:s3].directories.get('fogdirectorykey')
directory.attributes.should == get.attributes
directory.destroy
end