mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
flavors specs
This commit is contained in:
parent
7dc947ce06
commit
956177f235
4 changed files with 58 additions and 0 deletions
14
spec/aws/models/ec2/flavors_spec.rb
Normal file
14
spec/aws/models/ec2/flavors_spec.rb
Normal 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
|
14
spec/rackspace/models/servers/flavors_spec.rb
Normal file
14
spec/rackspace/models/servers/flavors_spec.rb
Normal 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
|
16
spec/shared_examples/flavors_examples.rb
Normal file
16
spec/shared_examples/flavors_examples.rb
Normal 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
|
14
spec/slicehost/models/flavors_spec.rb
Normal file
14
spec/slicehost/models/flavors_spec.rb
Normal 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
|
Loading…
Reference in a new issue