shard-spectator/spec/issues/github_issue_44_spec.cr

21 lines
597 B
Crystal
Raw Normal View History

require "../spec_helper"
2022-07-15 01:59:14 +00:00
Spectator.describe "GitHub Issue #44" 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
2022-07-14 19:53:30 +00:00
Process.run(command, shell: true, output: :pipe) do |_process|
end
end
end