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

[compute|aws] Fixes trailing whitespace in attributes

This commit is contained in:
Aaron Suggs 2011-04-19 15:48:40 -04:00
parent e8c5ace170
commit 3c6a677b80
3 changed files with 19 additions and 1 deletions

View file

@ -16,7 +16,7 @@ module Fog
def characters(string) def characters(string)
@value ||= '' @value ||= ''
@value << string @value << string.gsub(/\n.*/, '')
end end
def start_element(name, attrs = []) def start_element(name, attrs = [])

View file

@ -2,4 +2,16 @@ Shindo.tests("AWS::Compute | security_group", ['aws']) do
model_tests(AWS[:compute].security_groups, {:description => 'foggroupdescription', :name => 'foggroupname'}, true) model_tests(AWS[:compute].security_groups, {:description => 'foggroupdescription', :name => 'foggroupname'}, true)
tests("a group with trailing whitespace") do
@group = AWS[:compute].security_groups.create(:name => "foggroup with spaces ", :description => " fog group desc ")
test("name is correct") do
@group.name == "foggroup with spaces "
end
test("description is correct") do
@group.description == " fog group desc "
end
@group.destroy
end
end end

View file

@ -24,6 +24,12 @@ Shindo.tests("AWS::Compute | monitor", ['aws']) do
@instance.save @instance.save
[:id, :availability_zone, :flavor_id, :kernel_id, :image_id, :state].each do |attr|
test("instance##{attr} should not contain whitespace") do
nil == @instance.send(attr).match(/\s/)
end
end
test('#monitor = true') do test('#monitor = true') do
@instance.monitor = true @instance.monitor = true
@instance.monitoring == true @instance.monitoring == true