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

doc: provide useful error message when using Volume#server=

Direct users to use #attach
This commit is contained in:
Joshua Lane 2018-04-23 08:41:45 -07:00
parent 82e36a29f0
commit 1c938fb023
2 changed files with 8 additions and 0 deletions

View file

@ -117,6 +117,10 @@ module Fog
end
end
def server=(_)
raise NoMethodError, 'use Fog::Compute::AWS::Volume#attach(server, device)'
end
private
def attachmentSet=(new_attachment_set)

View file

@ -25,6 +25,10 @@ Shindo.tests('Fog::Compute[:aws] | volume', ['aws']) do
@instance.server.nil?
end
tests('#server=').raises(NoMethodError, 'use Fog::Compute::AWS::Volume#attach(server, device)') do
@instance.server = @server
end
tests('#attach(server, device)').succeeds do
@instance.attach(@server, '/dev/sdz1')
@instance.server == @server