我有这个规范文件,它试图运行一个将运行 dotnet cli 程序的脚本:
require 'spec_helper'
RSpec.describe 'Integration test', type: :aruba do
let(:command) { run "dotnet-test" }
it "test" do
command.write("test\n")
stop_all_commands
expect(command.output).to end_with("success\n")
end
end
dotnet-test
脚本:
dotnet run --project ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj -- $1
但我得到错误:
Failure/Error: expect(command.output).to end_with("success\n")
expected "MSBUILD : error MSB1009: Project file does not exist.\nSwitch: ../SomeProject/src/SomeProject.Console/SomeProject.Console.csproj\n\nThe build failed. Please fix the build errors and run again.\n" to end with "success\n"
但是,如果我从该目录运行脚本,则程序运行良好。无法弄清楚两者之间可能有什么区别。非常感谢您的帮助。