Skip to content

Commit e2f570c

Browse files
authored
Merge pull request #97 from zombocom/schneems/fix-wait
Fix Background::Wait and exercise in test.
2 parents 500fd85 + 537392f commit e2f570c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## HEAD
22

3+
- Fix: Internal error in `background.wait` introduced in 4.1.2 (https://github.com/zombocom/rundoc/pull/97)
4+
35
## 4.1.2
46

57
- Fix: Background task name lookup is now lazy, this fixes a bug when using `:::>- pre.erb background.start(...)` (https://github.com/zombocom/rundoc/pull/95)

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)