Skip to content

Commit 0deb856

Browse files
committed
Fix Background::Wait and exercise in test.
I accidentally used `name` instead of `@name` and apparently this functionality is not called under test. So I added tests. Before: ``` 87 runs, 251 assertions, 0 failures, 0 errors, 0 skips Coverage report generated for Integration Tests to /Users/rschneeman/Documents/projects/rundoc/coverage. Line Coverage: 95.32% (1998 / 2096) ``` After: ``` 87 runs, 251 assertions, 0 failures, 0 errors, 0 skips Coverage report generated for Integration Tests to /Users/rschneeman/Documents/projects/rundoc/coverage. Line Coverage: 95.66% (2006 / 2097) ```
1 parent 500fd85 commit 0deb856

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/rundoc/code_command/background/wait.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def initialize(name:, wait:, timeout: 5)
88
end
99

1010
def background
11-
@background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(name)
11+
@background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(@name)
1212
end
1313

1414
def to_md(env = {})

test/rundoc/code_commands/background_test.rb

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ def test_stdin_with_cat_echo
1919
output = stdin_write.call
2020
assert_equal("hello there" + $/, output)
2121

22+
Rundoc::CodeCommand::Background::Wait.new(
23+
name: "cat",
24+
wait: "hello"
25+
).call
26+
2227
Rundoc::CodeCommand::Background::Log::Clear.new(
2328
name: "cat"
2429
).call

0 commit comments

Comments
 (0)