You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a formula (snippet below) which builds the package from a git repo. The version sub command of the tool returns the sha of the git commit in it's output. In my tests, I want to check if the sha matches the one as specified in the formula (the revision field). Is there a variable available which makes the git revision available for use in the tests?
Thanks in advance.
classKn < Formuladesc"Command-line interface for managing Knative Serving and Eventing resources"homepage"https://github.com/knative/client"url"https://github.com/knative/client.git",tag: "v0.24.0",revision: "0bbb3ec9d92665d372d8393ef3036ba7e0c069a4"license"Apache-2.0"depends_on"bash"=>:builddepends_on"go"=>:builddefinstallENV["CGO_ENABLED"]="0"ENV["GO111MODULE"]="on"ENV["TAG"]="v#{version}"system"./hack/build.sh","--fast"bin.install"kn"endtestdoversion_output=shell_output("#{bin}/kn version")assert_match("Version: v#{version}",version_output)assert_match("Git Revision: ",version_output)endend
in assert_match("Git Revision: ", version_output) i want to do something like assert_match("Git Revision: #{revision}", version_output)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am writing a formula (snippet below) which builds the package from a git repo. The version sub command of the tool returns the sha of the git commit in it's output. In my tests, I want to check if the sha matches the one as specified in the formula (the
revision
field). Is there a variable available which makes the git revision available for use in the tests?Thanks in advance.
in
assert_match("Git Revision: ", version_output)
i want to do something likeassert_match("Git Revision: #{revision}", version_output)
Beta Was this translation helpful? Give feedback.
All reactions