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:
parent
e8c5ace170
commit
3c6a677b80
3 changed files with 19 additions and 1 deletions
|
@ -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 = [])
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue