spec/metadata_spec.rb in engineyard-metadata-0.2.3 vs spec/metadata_spec.rb in engineyard-metadata-0.2.4
- old
+ new
@@ -19,34 +19,59 @@
it 'by getting the app server hostnames' do
EY.metadata.app_servers.should == ["ec2-174-129-212-130.compute-1.amazonaws.com"]
end
+ it 'by getting the app server IDs' do
+ EY.metadata.app_servers('amazon_id').should == ['i-ff17d493']
+ end
+
it 'by getting the db server hostnames' do
EY.metadata.db_servers.should == ["ec2-67-202-19-255.compute-1.amazonaws.com"]
end
+ it 'by getting the db server instance IDs' do
+ EY.metadata.db_servers('amazon_id').should == ['i-f917d495']
+ end
+
+
it 'by getting the utilities hostnames' do
EY.metadata.utilities.should == []
end
+ it 'by getting the utilities IDs' do
+ EY.metadata.utilities('amazon_id').should == []
+ end
+
it 'by getting the app master hostname' do
EY.metadata.app_master.should == 'ec2-174-129-212-130.compute-1.amazonaws.com'
end
it 'by getting the db master hostname' do
EY.metadata.db_master.should == 'ec2-67-202-19-255.compute-1.amazonaws.com'
end
+ it 'by getting the db master instance ID' do
+ EY.metadata.db_master('amazon_id').should == 'i-f917d495'
+ end
+
it 'by getting the db slave hostnames' do
EY.metadata.db_slaves.should == []
end
+ it 'by getting the db slave instance IDs' do
+ EY.metadata.db_slaves('amazon_id').should == []
+ end
+
it 'by getting the app slave hostnames' do
EY.metadata.app_slaves.should == []
end
+ it 'by getting the app slave hostnames' do
+ EY.metadata.app_slaves('amazon_id').should == []
+ end
+
it 'by getting the solo hostname' do
EY.metadata.solo.should == nil
end
it 'by getting the environment name' do
@@ -214,9 +239,10 @@
it_should_behave_like "it does in all execution environments"
it_should_behave_like "it's executing outside the cloud"
end
describe "depending on .eyrc" do
before do
+ FileUtils.mkdir_p File.dirname(EY.metadata.eyrc_path)
File.open(EY.metadata.eyrc_path, 'w') { |f| f.write({'api_token' => FAKE_CLOUD_TOKEN + 'ccc'}.to_yaml) }
EY.metadata.environment_name = 'cm1_production_blue'
EY.metadata.ey_cloud_token.should == FAKE_CLOUD_TOKEN + 'ccc' # sanity check
end
it_should_behave_like "it does in all execution environments"