Get rid of exceptions/ folder.
This commit is contained in:
parent
9002b22fac
commit
d74d95d0cd
|
@ -46,7 +46,7 @@ module Vagrant
|
||||||
def run(callable, options=nil)
|
def run(callable, options=nil)
|
||||||
callable = Builder.new.use(callable) if callable.kind_of?(Class)
|
callable = Builder.new.use(callable) if callable.kind_of?(Class)
|
||||||
callable = self.class.actions[callable] if callable.kind_of?(Symbol)
|
callable = self.class.actions[callable] if callable.kind_of?(Symbol)
|
||||||
raise Exceptions::UncallableAction.new(callable) if !callable
|
raise ArgumentError.new("Argument to run must be a callable object or registered action.") if !callable
|
||||||
|
|
||||||
action_environment = Action::Environment.new(env)
|
action_environment = Action::Environment.new(env)
|
||||||
action_environment.merge!(options || {})
|
action_environment.merge!(options || {})
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
module Vagrant
|
|
||||||
module Exceptions
|
|
||||||
# Raised when an action sequence is trying to be run for an uncallable
|
|
||||||
# action (not a lambda, middleware, or registered sequence).
|
|
||||||
class UncallableAction < ::Exception
|
|
||||||
def initialize(callable)
|
|
||||||
super()
|
|
||||||
|
|
||||||
@callable = callable
|
|
||||||
end
|
|
||||||
|
|
||||||
def to_s
|
|
||||||
@callable.inspect
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -32,8 +32,8 @@ class ActionTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "raise an exception if a nil action is given" do
|
should "raise an exception if a nil action is given" do
|
||||||
assert_raises(Vagrant::Exceptions::UncallableAction) { @instance.run(nil) }
|
assert_raises(ArgumentError) { @instance.run(nil) }
|
||||||
assert_raises(Vagrant::Exceptions::UncallableAction) { @instance.run(:dontexist) }
|
assert_raises(ArgumentError) { @instance.run(:dontexist) }
|
||||||
end
|
end
|
||||||
|
|
||||||
should "run the callable item with the proper context" do
|
should "run the callable item with the proper context" do
|
||||||
|
|
Loading…
Reference in New Issue