Sha256: 132eab78af3b6634bcd84e7558c51e1917b84be6eced496a93e4e8599538ab58

Contents?: true

Size: 907 Bytes

Versions: 11

Compression:

Stored size: 907 Bytes

Contents

require 'spec_helper'
require 'config_builder/model'

describe ConfigBuilder::Model::Provider::VMwareFusion do
  describe "converting to a proc" do

    let(:vmx) { Hash.new }
    let(:fusion_config) { double('fusion provider config', :vmx => vmx) }
    let(:vm_config) { double('vagrant VM config', :provider => fusion_config) }

    before do
      allow(vm_config).to receive(:provider).and_yield(fusion_config)
    end

    it "assigns the gui value to the fusion provider object" do
      subject.attrs = {:gui => 'guivalue'}
      expect(fusion_config).to receive(:gui=).with('guivalue')
      p = subject.to_proc
      p.call(vm_config)
    end

    it "assigns the vmx value to the fusion provider object" do
      subject.attrs = {:vmx => {:hello => 'world'}}
      allow(fusion_config).to receive(:gui=)
      subject.call(vm_config)
      expect(vmx).to eq({:hello => 'world'})
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
vagrant-config_builder-0.15.1 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-config_builder-0.15.0 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-config_builder-0.14.0 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-config_builder-0.13.0 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-masonry-0.13.0 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-config_builder-0.12.0 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-config_builder-0.11.0 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-config_builder-0.10.1 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-config_builder-0.10.0 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-config_builder-0.9.0 spec/config_builder/model/provider/vmware_fusion_spec.rb
vagrant-config_builder-0.8.0 spec/config_builder/model/provider/vmware_fusion_spec.rb