spec/metadata_spec.rb in engineyard-metadata-0.1.0 vs spec/metadata_spec.rb in engineyard-metadata-0.1.1
- old
+ new
@@ -61,10 +61,14 @@
EY::Metadata.repository_uri.should == 'FAKE_REPOSITORY_URI'
end
end
shared_examples_for "it's executing outside the cloud" do
+ it 'gets the list of all environment names' do
+ EY::Metadata.environment_names.should == [ 'WRONG_ENVIRONMENT_NAME', 'FAKE_ENVIRONMENT_NAME' ]
+ end
+
it 'not get the present instance ID' do
lambda {
EY::Metadata.present_instance_id
}.should raise_error(EY::Metadata::CannotGetFromHere)
end
@@ -115,9 +119,15 @@
EY::Metadata.engine_yard_cloud_api.data.should be_a(Hash)
end
end
shared_examples_for "it's executing inside the cloud" do
+ it 'not get the list of all environment names' do
+ lambda {
+ EY::Metadata.environment_names
+ }.should raise_error(EY::Metadata::CannotGetFromHere)
+ end
+
it 'get the present instance ID' do
EY::Metadata.present_instance_id.should == PRESENT_INSTANCE_ID
end
it 'get the present instance role (as a string)' do