Fixup action tests

This commit fixes up the action tests by adding a `name` field for all
the Action classes used within the various tests.
This commit is contained in:
Brian Cain 2019-01-17 15:42:47 -08:00
parent 5e4850a0d2
commit 09846b30fe
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
3 changed files with 36 additions and 0 deletions

View File

@ -22,6 +22,10 @@ describe Vagrant::Action::Builder do
@app = app @app = app
end end
def self.name
"TestAction"
end
define_method(:call) do |env| define_method(:call) do |env|
env[:data] << "#{data}_in" env[:data] << "#{data}_in"
@app.call(env) @app.call(env)
@ -147,6 +151,10 @@ describe Vagrant::Action::Builder do
@app = app @app = app
end end
def self.name
"TestAction"
end
define_method(:call) do |env| define_method(:call) do |env|
env[:data] << "#{letter}1" env[:data] << "#{letter}1"
@app.call(env) @app.call(env)
@ -266,6 +274,10 @@ describe Vagrant::Action::Builder do
@app = app @app = app
end end
def self.name
"TestAction"
end
define_method(:call) do |env| define_method(:call) do |env|
inner = described_klass.new inner = described_klass.new
inner.use wrapper_proc[2] inner.use wrapper_proc[2]

View File

@ -10,6 +10,10 @@ describe Vagrant::Action::Builtin::Call do
@app = app @app = app
end end
def self.name
"TestAction"
end
define_method(:call) do |env| define_method(:call) do |env|
env[:data] << "#{data}_in" env[:data] << "#{data}_in"
@app.call(env) @app.call(env)
@ -103,6 +107,10 @@ describe Vagrant::Action::Builtin::Call do
env[:arg] = arg env[:arg] = arg
end end
def self.name
"TestAction"
end
def call(env); end def call(env); end
end end
@ -126,6 +134,10 @@ describe Vagrant::Action::Builtin::Call do
@env = env @env = env
end end
def self.name
"TestAction"
end
def call(env) def call(env)
@app.call(env) @app.call(env)
end end
@ -137,6 +149,10 @@ describe Vagrant::Action::Builtin::Call do
super super
end end
def self.name
"TestAction"
end
def recover(env) def recover(env)
env[:steps] << :recover_A env[:steps] << :recover_A
end end
@ -148,6 +164,10 @@ describe Vagrant::Action::Builtin::Call do
super super
end end
def self.name
"TestAction"
end
def recover(env) def recover(env)
env[:steps] << :recover_B env[:steps] << :recover_B
end end

View File

@ -28,6 +28,10 @@ describe Vagrant::Action::Runner do
def initialize(app, env) def initialize(app, env)
end end
def self.name
"TestAction"
end
def call(env) def call(env)
raise Exception, "BOOM" raise Exception, "BOOM"
end end