Skip to content

Commit

Permalink
Add parent to folder mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonMatthes committed Mar 16, 2019
1 parent 75edb0d commit 72a56f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/api/v_sphere_api_mocker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def vim_folder_mock(name, subfolders, vms, clusters) # rubocop:disable Metrics/A
children = subfolders + vms + clusters
children = extract_vim_objects children
folder = double
allow(folder).to receive(:name).and_return(name)
allow(folder).to receive(:children).and_return(children)
allow(folder).to receive(:name).and_return name
allow(folder).to receive(:parent).and_return nil
allow(folder).to receive(:children).and_return children
allow(folder).to receive(:is_a?).and_return false
allow(folder).to receive(:is_a?).with(RbVmomi::VIM::Folder).and_return true
allow(folder).to receive_message_chain(:MoveIntoFolder_Task, :wait_for_completion)
Expand Down

0 comments on commit 72a56f0

Please sign in to comment.