MCPcopy Create free account
hub / github.com/cloudfoundry/cli / WithCrashingApp

Function WithCrashingApp

integration/helpers/app.go:190–217  ·  view source on GitHub ↗

WithCrashingApp creates an application to use with your CLI command that will not successfully start its `web` process

(f func(dir string))

Source from the content-addressed store, hash-verified

188// WithCrashingApp creates an application to use with your CLI command
189// that will not successfully start its `web` process
190func WithCrashingApp(f func(dir string)) {
191 dir := TempDirAbsolutePath("", "crashing-ruby-app")
192 defer os.RemoveAll(dir)
193
194 err := os.WriteFile(filepath.Join(dir, "Procfile"), []byte(`---
195web: bogus bogus`,
196 ), 0666)
197 Expect(err).ToNot(HaveOccurred())
198
199 err = os.WriteFile(filepath.Join(dir, "Gemfile"), nil, 0666)
200 Expect(err).ToNot(HaveOccurred())
201
202 err = os.WriteFile(filepath.Join(dir, "Gemfile.lock"), []byte(`
203GEM
204 specs:
205
206PLATFORMS
207 ruby
208
209DEPENDENCIES
210
211BUNDLED WITH
212 2.1.4
213 `), 0666)
214 Expect(err).ToNot(HaveOccurred())
215
216 f(dir)
217}
218
219// WithBananaPantsApp creates a simple application to use with your CLI command
220// (typically CF Push). When pushing, be aware of specifying '-b

Callers 4

name_only_test.goFile · 0.92
no_wait_test.goFile · 0.92

Calls 1

TempDirAbsolutePathFunction · 0.85

Tested by

no test coverage detected