vagrant-skytap 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -0
  3. data/CHANGELOG.md +4 -0
  4. data/Gemfile +0 -3
  5. data/lib/vagrant-skytap/action/compose_environment.rb +0 -3
  6. data/lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb +0 -1
  7. data/lib/vagrant-skytap/action/prepare_nfs_valid_ids.rb +3 -2
  8. data/lib/vagrant-skytap/action/wait_for_communicator.rb +0 -1
  9. data/lib/vagrant-skytap/action.rb +0 -1
  10. data/lib/vagrant-skytap/api/busyable.rb +1 -1
  11. data/lib/vagrant-skytap/api/client.rb +0 -1
  12. data/lib/vagrant-skytap/api/interface.rb +0 -1
  13. data/lib/vagrant-skytap/api/public_ip.rb +1 -2
  14. data/lib/vagrant-skytap/api/published_service.rb +2 -3
  15. data/lib/vagrant-skytap/api/vpn.rb +1 -2
  16. data/lib/vagrant-skytap/command/publish_url/root.rb +1 -1
  17. data/lib/vagrant-skytap/command/up.rb +10 -4
  18. data/lib/vagrant-skytap/core_ext/object/blank.rb +0 -22
  19. data/lib/vagrant-skytap/core_ext/try.rb +0 -22
  20. data/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb +0 -1
  21. data/lib/vagrant-skytap/plugin.rb +1 -1
  22. data/lib/vagrant-skytap/util/compile_forwarded_ports.rb +1 -1
  23. data/lib/vagrant-skytap/version.rb +1 -1
  24. data/lib/vagrant-skytap.rb +0 -2
  25. data/spec/unit/actions/compose_environment_spec.rb +0 -3
  26. data/spec/unit/actions/update_hardware_spec.rb +0 -1
  27. data/spec/unit/base.rb +1 -8
  28. data/spec/unit/config_spec.rb +0 -4
  29. data/spec/unit/environment_spec.rb +14 -23
  30. data/spec/unit/forwarded_port_spec.rb +0 -2
  31. data/spec/unit/prepare_collision_params_spec.rb +0 -14
  32. data/spec/unit/publish_set_spec.rb +7 -15
  33. data/spec/unit/setup_helper_spec.rb +28 -48
  34. data/spec/unit/support/api_responses/empty_environment.json +1 -1
  35. data/spec/unit/support/shared/rest_api_context.rb +3 -0
  36. data/spec/unit/support/shared/skytap_context.rb +14 -0
  37. data/spec/unit/vm_spec.rb +8 -15
  38. data/vagrant-skytap.gemspec +4 -4
  39. metadata +7 -20
  40. data/.hgignore +0 -22
  41. data/.project +0 -11
  42. data/.rspec +0 -1
  43. data/spec/acceptance/base.rb +0 -24
  44. data/spec/acceptance/provider/halt_spec.rb +0 -25
  45. data/spec/acceptance/provider/up_spec.rb +0 -62
  46. data/spec/acceptance/shared/context_skytap.rb +0 -25
  47. data/spec/support/isolated_environment.rb +0 -67
  48. data/spec/unit/support/dummy_communicator.rb +0 -105
  49. data/spec/unit/support/dummy_provider.rb +0 -63
  50. data/spec/unit/support/isolated_environment.rb +0 -239
  51. data/spec/unit/support/shared/action_synced_folders_context.rb +0 -37
  52. data/spec/unit/support/shared/base_context.rb +0 -138
  53. data/spec/unit/support/shared/capability_helpers_context.rb +0 -51
  54. data/spec/unit/support/shared/plugin_command_context.rb +0 -34
  55. data/vagrant-spec.config.rb +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e80355442d175c31c247c1e440e82e19311bb28
4
- data.tar.gz: 86662fe7894e137edeef1252af62059c98422a48
3
+ metadata.gz: 24c83e15798abd9dd2e7df78bd984c2768dae164
4
+ data.tar.gz: 0198f2146818c63d8ef7fc0bf9808a20fdea288e
5
5
  SHA512:
6
- metadata.gz: 187ee028f6abb5fcc5b15124ca72fe98fe3902d82216243d4e0ff72291460c7b7c507f9544bb2c7dbc529aa80ea4f24deb147700d028af9afc9f55c56127a4a1
7
- data.tar.gz: 5afbffe84d4f5f3c4873941d5e8dae1eb7a717c8b3bdf112f4d4e8c8b1b37ac95d95813562eef08c22e788f1aa877e6d8a74b64a8256a5029ed8d15f05914246
6
+ metadata.gz: 533b0663bcd1ceee2c749db4cc4bc95a77bb2a1a940d90422fdb118ae182b72dcf10dfc84ccde3510590193511eec4d24ae9421dbbeb4cd2c601db6a5d402804
7
+ data.tar.gz: 231290cdc514f59aa84187f951a47b13742447a7a5fcfa78af9c1675c1e1efd02a4a2522c5e1f74817b39090ad10cc408b2c8c8fca031766b7ec6bbf30c8abb1
data/.gitignore CHANGED
@@ -19,3 +19,11 @@ Vagrantfile
19
19
  # RVM files for gemset/ruby setting
20
20
  .ruby-*
21
21
  .rvmrc
22
+ .ruby-version
23
+
24
+ # other source control
25
+ .hg
26
+ .hgignore
27
+ .byebug_history
28
+ .project
29
+ .rspec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.2.5 (February 3, 2016)
2
+
3
+ * Initial push to GitHub. Random cleanup, including getting rid of some unused test files.
4
+
1
5
  # 0.2.4 (February 3, 2016)
2
6
 
3
7
  * Fix bug which caused updating hardware to take effect for the first VM only.
data/Gemfile CHANGED
@@ -9,11 +9,8 @@ group :development do
9
9
  if File.exist?(File.expand_path("../../vagrant", __FILE__))
10
10
  gem 'vagrant', path: "../vagrant"
11
11
  else
12
- # TODO test against tip
13
12
  gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => 'v1.7.2'
14
13
  end
15
- gem "byebug"
16
-
17
14
 
18
15
  if File.exist?(File.expand_path("../../vagrant-spec", __FILE__))
19
16
  gem 'vagrant-spec', path: "../vagrant-spec"
@@ -93,9 +93,6 @@ module VagrantPlugins
93
93
  end
94
94
 
95
95
  # Fetch the source VMs for the given machines.
96
- # TODO Optimize by downloading unique parent objects, and pick
97
- # the VM child objects; Set the VMs' parent object so Vm#region
98
- # doesn't require another GET.
99
96
  #
100
97
  # @param [Array] machines Set of [Vagrant::Machine] objects
101
98
  # @return [Hash] mapping of machine names to [API::Vm] objects
@@ -29,7 +29,6 @@ module VagrantPlugins
29
29
  @app = app
30
30
  end
31
31
 
32
- # This logic is based on the VirtualBox provider
33
32
  def call(env)
34
33
  # Get the forwarded ports used by other virtual machines and
35
34
  # consider those in use as well.
@@ -29,8 +29,9 @@ module VagrantPlugins
29
29
  # Creates a list of vm ids from all Skytap VMs in Vagrant's global machine
30
30
  # index. Any Vagrant machine not on this list will have its NFS entry
31
31
  # pruned by the SyncedFolderCleanup action.
32
- # NOTE: Unfortunately, Vagrant providers have no way to know about each
33
- # other's machines. https://github.com/mitchellh/vagrant/issues/6439
32
+ # NOTE: Unfortunately Vagrant providers have no way to know about each
33
+ # other's machines, so there's an impact on NFS mounts for machines
34
+ # from other providers. https://github.com/mitchellh/vagrant/issues/6439
34
35
  class PrepareNFSValidIds
35
36
  include MixinMachineIndex
36
37
 
@@ -52,7 +52,6 @@ module VagrantPlugins
52
52
  Timeout.timeout(env[:machine].config.vm.boot_timeout) do
53
53
  while true do
54
54
  begin
55
- # TODO Is there a clean way to just invoke the built-in action?
56
55
  break builtin_action_call(env)
57
56
  rescue Errno::ENETUNREACH
58
57
  @logger.info("Rescued Errno::ENETUNREACH and retrying original WaitForCommunicator action.")
@@ -143,7 +143,6 @@ module VagrantPlugins
143
143
  def self.action_read_state
144
144
  Vagrant::Action::Builder.new.tap do |b|
145
145
  b.use action_fetch_environment
146
- #TODO:NLA Can this whole action be removed?
147
146
  b.use ReadState
148
147
  end
149
148
  end
@@ -41,7 +41,7 @@ module VagrantPlugins
41
41
  begin
42
42
  Timeout.timeout(timeout) do
43
43
  loop do
44
- break if env[:interrupted] # is this right?
44
+ break if env[:interrupted]
45
45
  begin
46
46
  yield
47
47
  rescue Errors::ResourceBusy
@@ -38,7 +38,6 @@ module VagrantPlugins
38
38
  uri = URI.parse(config.base_url)
39
39
  @http = Net::HTTP.new(uri.host, uri.port)
40
40
 
41
- #TODO:NLA Turn this on conditionally based on configuration value.
42
41
  @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
43
42
 
44
43
  @http.use_ssl = uri.port == 443 || uri.scheme == 'https'
@@ -121,7 +121,6 @@ module VagrantPlugins
121
121
  end
122
122
 
123
123
  def create_published_service(internal_port)
124
- #TODO:NLA Move this into PublishedService::create! Same with other places.
125
124
  begin
126
125
  resp = api_client.post("#{url}/services", JSON.dump(internal_port: internal_port))
127
126
  rescue Errors::OperationFailed => ex
@@ -22,7 +22,6 @@
22
22
 
23
23
  require 'vagrant-skytap/api/resource'
24
24
 
25
- #TODO:NLA Move this to another class, properly namespaced.
26
25
  class PublicIpChoice
27
26
  attr_reader :env, :ip, :iface, :execution
28
27
 
@@ -47,7 +46,7 @@ class PublicIpChoice
47
46
  execution.execute
48
47
 
49
48
  host = ip.address
50
- port = 22 #TODO:NLA Use constant.
49
+ port = 22
51
50
  [host, port]
52
51
  end
53
52
 
@@ -22,7 +22,6 @@
22
22
 
23
23
  require 'vagrant-skytap/api/resource'
24
24
 
25
- #TODO:NLA Move this to another class, properly namespaced.
26
25
  class PublishedServiceChoice
27
26
  attr_reader :env, :iface, :service, :execution
28
27
 
@@ -48,7 +47,7 @@ class PublishedServiceChoice
48
47
  end
49
48
 
50
49
  def valid?
51
- service.nil? || service.internal_port == 22 #TODO:NLA Use constant
50
+ service.nil? || service.internal_port == 22
52
51
  end
53
52
 
54
53
  class ServiceExecution
@@ -85,7 +84,7 @@ class PublishedServiceChoice
85
84
  end
86
85
 
87
86
  def execute
88
- @service = iface.create_published_service(22) #TODO:NLA Use constant
87
+ @service = iface.create_published_service(22)
89
88
  end
90
89
  end
91
90
  end
@@ -24,7 +24,6 @@ require 'vagrant-skytap/util/subnet'
24
24
  require 'vagrant-skytap/api/resource'
25
25
  require 'vagrant-skytap/api/vpn_attachment'
26
26
 
27
- #TODO:NLA Move this to another class, properly namespaced.
28
27
  class VpnChoice
29
28
  attr_reader :env, :vpn, :vm, :iface, :attachment, :execution
30
29
 
@@ -55,7 +54,7 @@ class VpnChoice
55
54
 
56
55
  @iface = vm.reload.interfaces.detect{|i| i.id == iface.id }
57
56
  host = iface.address_for(vpn)
58
- port = 22 #TODO:NLA Use constant
57
+ port = 22
59
58
 
60
59
  [host, port]
61
60
  end
@@ -55,7 +55,7 @@ module VagrantPlugins
55
55
 
56
56
  def execute
57
57
  if @main_args.include?("-h") || @main_args.include?("--help")
58
- # Print the help for all the box commands.
58
+ # Print the help for all the publish-url commands.
59
59
  return help
60
60
  end
61
61
 
@@ -20,10 +20,13 @@
20
20
  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21
21
  # DEALINGS IN THE SOFTWARE.
22
22
 
23
- # We've subclassed the builtin "up" command to alter how
24
- # parallelization is implemented. Instead of making concurrent requests to run
25
- # individual VMs, we make a single REST call to update the runstates of
26
- # multiple VMs within the containing Skytap environment.
23
+ # We've subclassed the "up" command that ships with Vagrant core to
24
+ # implement parallelization with REST calls that operate on multiple
25
+ # VMs simultaneously -- since the entire environment is locked while
26
+ # VMs are created or run, the multithreaded approach does not work.
27
+ # Unfortunately the #execute method contains a lot of duplicate code,
28
+ # when all we need to modify is the #batch block which invokes
29
+ # action_up. (See #bring_up_machines below.)
27
30
 
28
31
  require Vagrant.source_root.join("plugins/commands/up/command")
29
32
 
@@ -93,6 +96,9 @@ module VagrantPlugins
93
96
  names = nil if autostart && names.empty?
94
97
  end
95
98
 
99
+ # Collect the machines first so we know what their provider
100
+ # is, and decide whether to call the Vagrant core implementation
101
+ # of this command.
96
102
  with_target_vms(names, provider: options[:provider]) {|machine| machines << machine}
97
103
  unless machines.first.provider_name == :skytap
98
104
  @logger.debug("Calling default 'Up' implementation.")
@@ -1,25 +1,3 @@
1
- # Copyright (c) 2014-2016 Skytap, Inc.
2
- #
3
- # The MIT License (MIT)
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
- # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21
- # DEALINGS IN THE SOFTWARE.
22
-
23
1
  # Copied from Rails ActiveSupport 2.3.18:
24
2
  # activesupport-2.3.18/lib/active_support/core_ext/object/blank.rb
25
3
  #
@@ -1,25 +1,3 @@
1
- # Copyright (c) 2014-2016 Skytap, Inc.
2
- #
3
- # The MIT License (MIT)
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
- # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21
- # DEALINGS IN THE SOFTWARE.
22
-
23
1
  # Copied from Rails ActiveSupport 2.3.18:
24
2
  # activesupport-2.3.18/lib/active_support/core_ext/try.rb
25
3
  #
@@ -168,7 +168,6 @@ module VagrantPlugins
168
168
  # @return [Array] of [String]
169
169
  def ssh_args(fp, machine)
170
170
  ssh_info = machine.ssh_info
171
- # TODO: tune these settings
172
171
  ssh_options = {
173
172
  "ServerAliveInterval" => 10,
174
173
  "ServerAliveCountMax" => 3,
@@ -38,7 +38,7 @@ module VagrantPlugins
38
38
  name "Skytap"
39
39
  description <<-DESC
40
40
  This plugin installs a provider that allows Vagrant to manage
41
- machines in Skytap (EC2/VPC).
41
+ machines in Skytap.
42
42
  DESC
43
43
 
44
44
  config(:skytap, :provider) do
@@ -29,7 +29,7 @@ module VagrantPlugins
29
29
  module CompileForwardedPorts
30
30
  include Vagrant::Util::ScopedHashOverride
31
31
 
32
- # This method compiles the forwarded ports into {ForwardedPort}
32
+ # This method compiles the forwarded ports into [ForwardedPort]
33
33
  # models.
34
34
  def compile_forwarded_ports(config)
35
35
  mappings = {}
@@ -22,6 +22,6 @@
22
22
 
23
23
  module VagrantPlugins
24
24
  module Skytap
25
- VERSION = "0.2.4"
25
+ VERSION = "0.2.5"
26
26
  end
27
27
  end
@@ -20,8 +20,6 @@
20
20
  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21
21
  # DEALINGS IN THE SOFTWARE.
22
22
 
23
- # TODO:NLA To add the box initially:
24
- # $ bundle exec vagrant box add skytap-dummy.box --provider=skytap --name=skytap-dummy
25
23
  require "pathname"
26
24
 
27
25
  require "vagrant-skytap/core_ext/object/blank"
@@ -23,16 +23,13 @@
23
23
  require File.expand_path("../../base", __FILE__)
24
24
 
25
25
  describe VagrantPlugins::Skytap::Action::ComposeEnvironment do
26
- include_context "unit"
27
26
  include_context "rest_api"
28
27
 
29
28
  let(:app) { lambda { |env| } }
30
29
  let(:env) { { machine: machine, machines: [machine], environment: environment, ui: ui, api_client: api_client } }
31
- let(:base_url) {"http://example.com/"}
32
30
  let(:provider_config) do
33
31
  double(:provider_config, vm_url: "/vms/1", username: "jsmith", api_token: "123123", base_url: base_url)
34
32
  end
35
- let(:ui) { double(:ui, info: nil) }
36
33
  let(:api_client) { API::Client.new(provider_config) }
37
34
 
38
35
  let(:machine) { double(:machine, name: "vm1", id: nil, :id= => nil, provider_config: provider_config) }
@@ -24,7 +24,6 @@ require File.expand_path("../../base", __FILE__)
24
24
  require "vagrant-skytap/action/update_hardware"
25
25
 
26
26
  describe VagrantPlugins::Skytap::Action::UpdateHardware do
27
- include_context "unit"
28
27
  include_context "skytap"
29
28
 
30
29
  let(:app) { lambda { |env| } }
data/spec/unit/base.rb CHANGED
@@ -39,12 +39,6 @@ require "vagrant-skytap"
39
39
  $:.unshift File.expand_path("../../", __FILE__)
40
40
 
41
41
  # Load in helpers
42
- require "unit/support/dummy_communicator"
43
- require "unit/support/dummy_provider"
44
- require "unit/support/shared/base_context"
45
- require "unit/support/shared/action_synced_folders_context"
46
- require "unit/support/shared/capability_helpers_context"
47
- require "unit/support/shared/plugin_command_context"
48
42
  require "unit/support/shared/skytap_context"
49
43
  require "unit/support/shared/rest_api_context"
50
44
 
@@ -67,8 +61,7 @@ end
67
61
  # Vagrantfile anywhere, or at least this minimizes those chances.
68
62
  ENV["VAGRANT_CWD"] = Dir.mktmpdir("vagrant")
69
63
 
70
- # Set the dummy provider to the default for tests
71
- ENV["VAGRANT_DEFAULT_PROVIDER"] = "dummy"
64
+ ENV["VAGRANT_DEFAULT_PROVIDER"] = "skytap"
72
65
 
73
66
  # Unset all host plugins so that we aren't executing subprocess things
74
67
  # to detect a host for every test.
@@ -50,10 +50,6 @@ describe VagrantPlugins::Skytap::Config do
50
50
  end
51
51
 
52
52
  describe "overriding defaults" do
53
- # I typically don't meta-program in tests, but this is a very
54
- # simple boilerplate test, so I cut corners here. It just sets
55
- # each of these attributes to "foo" in isolation, and reads the value
56
- # and asserts the proper result comes back out.
57
53
  [:username, :api_token, :base_url, :vm_url,
58
54
  :vpn_url, :instance_ready_timeout,
59
55
  :cpus, :cpuspersocket, :ram, :guestos].each do |attribute|
@@ -23,7 +23,6 @@
23
23
  require_relative 'base'
24
24
 
25
25
  describe VagrantPlugins::Skytap::API::Environment do
26
- include_context "unit"
27
26
  include_context "rest_api"
28
27
 
29
28
  let(:json_path) { File.join(File.expand_path('..', __FILE__), 'support', 'api_responses') }
@@ -57,27 +56,19 @@ describe VagrantPlugins::Skytap::API::Environment do
57
56
  end
58
57
  end
59
58
 
60
- let(:iso_env) do
61
- # We have to create a Vagrantfile so there is a root path
62
- env = isolated_environment
63
- env.vagrantfile("")
64
- env.create_vagrant_env
65
- end
66
-
67
- let(:machine) { iso_env.machine(iso_env.machine_names[0], :dummy) }
68
- let(:env) {{ machine: machine }}
69
- let(:instance) { described_class.new(attrs, env) }
70
-
71
- let(:api_client) do
72
- # By default, all GET requests will return an environment with VM1, VM2, and 1 network
73
- double('api_client',
74
- get: double('resp', body: JSON.dump(attrs))
75
- )
59
+ let(:provider_config) do
60
+ double(:provider_config, vm_url: "/vms/1", username: "jsmith", api_token: "123123", base_url: base_url)
76
61
  end
62
+ let(:api_client) { API::Client.new(provider_config) }
63
+ let(:machine) { double(:machine, name: "vm1", id: nil, :id= => nil, provider_config: provider_config) }
64
+ let(:env) { { machine: machine, api_client: api_client } }
65
+ let(:instance) { described_class.new(attrs, env) }
77
66
 
78
67
  # Ensure tests are not affected by Skytap credential environment variables
79
68
  before :each do
80
69
  ENV.stub(:[] => nil)
70
+ stub_request(:get, /.*/).to_return(body: '{}', status: 200)
71
+ stub_request(:get, %r{/configurations/\d+}).to_return(body: JSON.dump(attrs), status: 200)
81
72
  end
82
73
 
83
74
  describe "check_vm_before_adding class method" do
@@ -176,14 +167,14 @@ describe VagrantPlugins::Skytap::API::Environment do
176
167
  end
177
168
 
178
169
  describe "reload" do
170
+ before do
171
+ new_attrs = attrs.merge('name' => 'Environment with 2 vms')
172
+ stub_request(:get, %r{/configurations/\d+}).to_return(body: JSON.dump(new_attrs), status: 200)
173
+ end
174
+
179
175
  subject do
180
176
  old_attrs = attrs_one_vm.merge('networks' => [], 'publish_sets' => [])
181
- new_attrs = attrs.merge('name' => 'Environment with 2 vms')
182
- client = double('api_client',
183
- get: double('resp', body: JSON.dump(new_attrs))
184
- )
185
- myenv = env.merge(api_client: client)
186
- described_class.new(old_attrs, myenv)
177
+ described_class.new(old_attrs, env)
187
178
  end
188
179
 
189
180
  it "reloads the child objects" do