From 42419bbd4945e21950f3764756e669f622be5af3 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Mon, 19 Mar 2018 10:56:09 -0700 Subject: [PATCH] Fix rspec tests --- lib/vagrant/config/v2/root.rb | 1 - plugins/kernel_v2/config/ssh.rb | 1 - plugins/kernel_v2/config/trigger.rb | 1 - plugins/kernel_v2/config/vm_trigger.rb | 2 +- test/unit/plugins/kernel_v2/config/vm_trigger_test.rb | 8 +++++--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/vagrant/config/v2/root.rb b/lib/vagrant/config/v2/root.rb index 8fde6f267..b41e5c031 100644 --- a/lib/vagrant/config/v2/root.rb +++ b/lib/vagrant/config/v2/root.rb @@ -1,5 +1,4 @@ require "set" -require 'pry' require "vagrant/config/v2/util" diff --git a/plugins/kernel_v2/config/ssh.rb b/plugins/kernel_v2/config/ssh.rb index 4efd89951..1dc3d51c9 100644 --- a/plugins/kernel_v2/config/ssh.rb +++ b/plugins/kernel_v2/config/ssh.rb @@ -1,5 +1,4 @@ require "vagrant" -require 'pry' require_relative "ssh_connect" diff --git a/plugins/kernel_v2/config/trigger.rb b/plugins/kernel_v2/config/trigger.rb index 41e9bf641..0b24b450c 100644 --- a/plugins/kernel_v2/config/trigger.rb +++ b/plugins/kernel_v2/config/trigger.rb @@ -1,5 +1,4 @@ require "vagrant" -require 'pry' require File.expand_path("../vm_trigger", __FILE__) diff --git a/plugins/kernel_v2/config/vm_trigger.rb b/plugins/kernel_v2/config/vm_trigger.rb index cdbf6a6dd..edee528ba 100644 --- a/plugins/kernel_v2/config/vm_trigger.rb +++ b/plugins/kernel_v2/config/vm_trigger.rb @@ -1,5 +1,5 @@ require 'log4r' -require 'pry' + require Vagrant.source_root.join('plugins/provisioners/shell/config') module VagrantPlugins diff --git a/test/unit/plugins/kernel_v2/config/vm_trigger_test.rb b/test/unit/plugins/kernel_v2/config/vm_trigger_test.rb index 245fab5bf..c7b7fb139 100644 --- a/test/unit/plugins/kernel_v2/config/vm_trigger_test.rb +++ b/test/unit/plugins/kernel_v2/config/vm_trigger_test.rb @@ -5,20 +5,22 @@ require Vagrant.source_root.join("plugins/kernel_v2/config/vm_trigger") describe VagrantPlugins::Kernel_V2::VagrantConfigTrigger do include_context "unit" - subject { described_class.new } + let(:command) { :up } + + subject { described_class.new(command) } let(:machine) { double("machine") } def assert_invalid errors = subject.validate(machine) - if !errors.values.any? { |v| !v.empty? } + if !errors.empty? { |v| !v.empty? } raise "No errors: #{errors.inspect}" end end def assert_valid errors = subject.validate(machine) - if !errors.values.all? { |v| v.empty? } + if !errors.empty? { |v| v.empty? } raise "Errors: #{errors.inspect}" end end