mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add spec for GitHub issue 44
https://github.com/icy-arctic-fox/spectator/issues/44
This commit is contained in:
parent
9efb6c95dd
commit
be973cdc4b
1 changed files with 20 additions and 0 deletions
20
spec/issues/github_issue_44_spec.cr
Normal file
20
spec/issues/github_issue_44_spec.cr
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
require "../spec_helper"
|
||||||
|
|
||||||
|
Spectator.describe Test do
|
||||||
|
inject_mock Process do
|
||||||
|
# Instance variable that can be nil, provide a default.
|
||||||
|
@process_info = Crystal::System::Process.new(0)
|
||||||
|
end
|
||||||
|
|
||||||
|
let(command) { "ls -l" }
|
||||||
|
let(exception) { File::NotFoundError.new("File not found", file: "test.file") }
|
||||||
|
|
||||||
|
before_each do
|
||||||
|
expect(Process).to receive(:run).with(command, shell: true, output: :pipe).and_raise(exception)
|
||||||
|
end
|
||||||
|
|
||||||
|
skip "must stub Process.run", skip: "Method mock not applied" do
|
||||||
|
Process.run(command, shell: true, output: :pipe) do |process|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue