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

flavors specs

This commit is contained in:
geemus (Wesley Beary) 2010-02-16 20:05:36 -08:00
parent 7dc947ce06
commit 956177f235
4 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,14 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../../shared_examples/flavors_examples'
describe 'Fog::AWS::EC2::Flavors' do
it_should_behave_like "Flavors"
subject { @flavor = @flavors.all.first }
before(:each) do
@flavors = AWS[:ec2].flavors
end
end

View file

@ -0,0 +1,14 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../../shared_examples/flavors_examples'
describe 'Fog::AWS::Rackspace::Flavors' do
it_should_behave_like "Flavors"
subject { @flavor = @flavors.all.first }
before(:each) do
@flavors = Rackspace[:servers].flavors
end
end

View file

@ -0,0 +1,16 @@
shared_examples_for "Flavors" do
describe "#get" do
it "should return a matching flavor if one exists" do
get = @flavors.get(subject.id)
subject.attributes.should == get.attributes
end
it "should return nil if no matching server exists" do
@flavors.get('0').should be_nil
end
end
end

View file

@ -0,0 +1,14 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../../shared_examples/flavors_examples'
describe 'Fog::AWS::Slicehost::Flavors' do
it_should_behave_like "Flavors"
subject { @flavor = @flavors.all.first }
before(:each) do
@flavors = Slicehost[:slices].flavors
end
end