diff --git a/lib/rundoc/code_command/background/wait.rb b/lib/rundoc/code_command/background/wait.rb index 5de3747..0d0d5c7 100644 --- a/lib/rundoc/code_command/background/wait.rb +++ b/lib/rundoc/code_command/background/wait.rb @@ -8,7 +8,7 @@ def initialize(name:, wait:, timeout: 5) end def background - @background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(name) + @background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(@name) end def to_md(env = {}) diff --git a/test/rundoc/code_commands/background_test.rb b/test/rundoc/code_commands/background_test.rb index e17331c..0636e78 100644 --- a/test/rundoc/code_commands/background_test.rb +++ b/test/rundoc/code_commands/background_test.rb @@ -19,6 +19,11 @@ def test_stdin_with_cat_echo output = stdin_write.call assert_equal("hello there" + $/, output) + Rundoc::CodeCommand::Background::Wait.new( + name: "cat", + wait: "hello" + ).call + Rundoc::CodeCommand::Background::Log::Clear.new( name: "cat" ).call