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:
parent
82e36a29f0
commit
1c938fb023
2 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue