spec/aerosol/launch_configuration_spec.rb in aerosol-1.1.0 vs spec/aerosol/launch_configuration_spec.rb in aerosol-1.2.0
- old
+ new
@@ -392,6 +392,49 @@
new.launch_configuration_name.should == 'this-aws-id-abc-123'
new.image_id.should == 'ami-456'
end
end
end
+
+ describe '#corrected_user_data' do
+ let(:encoded_user_data_string) { Base64.encode64('test') }
+
+ context 'when the user_data is a String' do
+ subject do
+ described_class.new do
+ name :corrected_user_data
+ user_data 'test'
+ end
+ end
+
+ it 'correctly encodes to base64' do
+ expect(subject.corrected_user_data).to eq(encoded_user_data_string)
+ end
+ end
+
+ context 'when the user_data is a Proc' do
+ subject do
+ described_class.new do
+ name :corrected_user_data_2
+ user_data { 'test' }
+ end
+ end
+
+ it 'correctly encodes to base64' do
+ expect(subject.corrected_user_data).to eq(encoded_user_data_string)
+ end
+ end
+ end
+
+ describe '#meta_data' do
+ subject do
+ described_class.new do
+ name :my_launch_config
+ meta_data('Test' => '1')
+ end
+ end
+
+ it 'returns the hash' do
+ expect(subject.meta_data['Test']).to eq('1')
+ end
+ end
end