Skip to content

Commit

Permalink
Use let in the specs
Browse files Browse the repository at this point in the history
  • Loading branch information
tas50 committed Nov 26, 2015
1 parent 4ec1fab commit fd04eff
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions spec/unit/plugins/virtualbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,31 @@
end

context 'when VBoxControl shellout succeeds' do
let(:plugin) { get_plugin('virtualbox') }

before(:each) do
@plugin = get_plugin('virtualbox')
allow(@plugin).to receive(:shell_out).with('VBoxControl guestproperty enumerate').and_return(mock_shell_out(0, vbox_output, ''))
@plugin.run
allow(plugin).to receive(:shell_out).with('VBoxControl guestproperty enumerate').and_return(mock_shell_out(0, vbox_output, ''))
plugin.run
end

it 'should set the host version' do
expect(@plugin[:virtualbox][:host][:version]).to eql('5.0.10')
expect(plugin[:virtualbox][:host][:version]).to eql('5.0.10')
end

it 'should set the host revision' do
expect(@plugin[:virtualbox][:host][:revision]).to eql('104061')
expect(plugin[:virtualbox][:host][:revision]).to eql('104061')
end

it 'should set the host language' do
expect(@plugin[:virtualbox][:host][:language]).to eql('en_US')
expect(plugin[:virtualbox][:host][:language]).to eql('en_US')
end

it 'should set the guest additions version' do
expect(@plugin[:virtualbox][:guest][:guest_additions_version]).to eql('5.0.2')
expect(plugin[:virtualbox][:guest][:guest_additions_version]).to eql('5.0.2')
end

it 'should set the guest additions revision' do
expect(@plugin[:virtualbox][:guest][:guest_additions_revision]).to eql('102096')
expect(plugin[:virtualbox][:guest][:guest_additions_revision]).to eql('102096')
end
end
end

0 comments on commit fd04eff

Please sign in to comment.