Class: CommandTreeTest

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/kube/ctl/command_tree.rb,
lib/kube/ctl/string_builder.rb

Instance Method Summary collapse

Instance Method Details

#assert_buffer(result, expected) ⇒ Object



118
119
120
# File 'lib/kube/ctl/string_builder.rb', line 118

def assert_buffer(result, expected)
  assert_equal expected, result.to_a
end

#assert_results(result, final = nil, commands:, resources:, flags: nil, errors: nil, valid: true) ⇒ Object



180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/kube/ctl/command_tree.rb', line 180

def assert_results(result, final = nil, commands:, resources:, flags: nil, errors: nil, valid: true)
  assert_equal commands, result.commands
  assert_equal resources, result.resources
  if valid
    assert_predicate result, :valid
  else
    refute_predicate result, :valid
  end

  assert_equal flags, result.flags unless flags.nil?
  assert_equal errors, result.errors unless errors.nil?
  assert_equal final, result.to_s unless final.nil?
end

#assert_string(result, expected) ⇒ Object



122
123
124
# File 'lib/kube/ctl/string_builder.rb', line 122

def assert_string(result, expected)
  assert_equal expected, result.to_s
end

#sb(&block) ⇒ Object



114
115
116
# File 'lib/kube/ctl/string_builder.rb', line 114

def sb(&block)
  Kube.ctl(&block)
end

#setupObject



175
176
177
178
# File 'lib/kube/ctl/command_tree.rb', line 175

def setup
  data = YAML.load_file(File.expand_path("../../../data/kubectl.yaml", __dir__))
  @tree = Kube::Ctl::CommandTree.new(data)
end

#test_apply_file_all_prune_allowlistObject



308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/kube/ctl/command_tree.rb', line 308

def test_apply_file_all_prune_allowlist
  result = @tree.evaluate(Kube.ctl { apply.file("manifest.yaml").all(true).prune_allowlist("core/v1/ConfigMap") })

  assert_results(
    result,
    "apply --file manifest.yaml --all --prune-allowlist core/v1/ConfigMap",
    commands: ["apply"],
    resources: [],
    flags: ["--file manifest.yaml", "--all", "--prune-allowlist core/v1/ConfigMap"],
    valid: true
  )
end

#test_call_with_space_node_resource_and_patch_file_flagObject



282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/kube/ctl/command_tree.rb', line 282

def test_call_with_space_node_resource_and_patch_file_flag
  result = @tree.evaluate(Kube.ctl.patch.("node k8s-node-1").patch_file("file.yaml"))

  assert_results(
    result,
    "patch node k8s-node-1 --patch-file file.yaml",
    commands: ["patch"],
    resources: ["node k8s-node-1"],
    flags: ["--patch-file file.yaml"],
    valid: true
  )
end

#test_flag_like_tokens_are_kept_separateObject



243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/kube/ctl/command_tree.rb', line 243

def test_flag_like_tokens_are_kept_separate
  result = @tree.evaluate(Kube.ctl { get.deployment/v1.output("yaml") })

  assert_results(
    result,
    "get deployment/v1 --output yaml",
    commands: ["get"],
    resources: ["deployment/v1"],
    flags: ["--output yaml"],
    valid: true
  )
end

#test_hyphenated_node_resource_with_patch_file_flagObject



269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/kube/ctl/command_tree.rb', line 269

def test_hyphenated_node_resource_with_patch_file_flag
  result = @tree.evaluate(Kube.ctl { patch.node.k8s-node-1.patch_file("file.yaml") })

  assert_results(
    result,
    "patch node.k8s-node-1 --patch-file file.yaml",
    commands: ["patch"],
    resources: ["node.k8s-node-1"],
    flags: ["--patch-file file.yaml"],
    valid: true
  )
end

#test_invalid_resource_is_reported_when_dataset_enabledObject



230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/kube/ctl/command_tree.rb', line 230

def test_invalid_resource_is_reported_when_dataset_enabled
  dataset = ["pod.v1/apps"]
  result = @tree.evaluate(Kube.ctl { get.pod.v1.apps }, resource_dataset: dataset)

  assert_results(
    result,
    commands: ["get"],
    resources: ["pod.v1.apps"],
    errors: ["unknown resource: `pod.v1.apps`"],
    valid: false
  )
end

#test_kubectl_annotate_f_pod_json_description_my_frontendObject



132
133
134
135
136
# File 'lib/kube/ctl/string_builder.rb', line 132

def test_kubectl_annotate_f_pod_json_description_my_frontend
  result = Kube.ctl { annotate.f('pod.json').(description: 'my frontend') }
  assert_buffer(result, [["annotate", []], ["f", ["pod.json"]], [{description: 'my frontend'}]])
  assert_string(result, "annotate -f pod.json description='my frontend'")
end

#test_kubectl_annotate_overwrite_pods_foo_description_my_frontend_running_nginxObject



138
139
140
141
142
# File 'lib/kube/ctl/string_builder.rb', line 138

def test_kubectl_annotate_overwrite_pods_foo_description_my_frontend_running_nginx
  result = Kube.ctl { annotate.overwrite(true).pods.foo.(description: 'my frontend running nginx')}
  assert_buffer(result, [["annotate", []], ["overwrite", [true]], ["pods", []], ["foo", []], [{description: 'my frontend running nginx'}]])
  assert_string(result, "annotate --overwrite pods foo description='my frontend running nginx'")
end

#test_kubectl_annotate_pods_all_description_my_frontend_running_nginxObject



144
145
146
147
148
# File 'lib/kube/ctl/string_builder.rb', line 144

def test_kubectl_annotate_pods_all_description_my_frontend_running_nginx
  result = Kube.ctl { annotate.pods.all(true).(description: 'my frontend running nginx')}
  assert_buffer(result, [["annotate", []], ["pods", []], ["all", [true]], [{description: 'my frontend running nginx'}]])
  assert_string(result, "annotate pods --all description='my frontend running nginx'")
end

#test_kubectl_annotate_pods_foo_description_my_frontendObject



126
127
128
129
130
# File 'lib/kube/ctl/string_builder.rb', line 126

def test_kubectl_annotate_pods_foo_description_my_frontend
  result = Kube.ctl { annotate.pods.foo.(description: 'my frontend') }
  assert_buffer(result, [["annotate", []], ["pods", []], ["foo", []], [{description: 'my frontend'}]])
  assert_string(result, "annotate pods foo description='my frontend'")
end

#test_kubectl_annotate_pods_foo_description_my_frontend_running_nginx_resource_version_1Object



150
151
152
153
154
# File 'lib/kube/ctl/string_builder.rb', line 150

def test_kubectl_annotate_pods_foo_description_my_frontend_running_nginx_resource_version_1
  result = Kube.ctl { annotate.pods.foo.(description: 'my frontend running nginx').resource_version(1)}
  assert_buffer(result, [["annotate", []], ["pods", []], ["foo", []], [{description: 'my frontend running nginx'}], ["resource_version", [1]]])
  assert_string(result, "annotate pods foo description='my frontend running nginx' --resource-version=1")
end

#test_kubectl_api_versionsObject

Skipped: trailing dash (description-) is not valid Ruby syntax def test_kubectl_annotate_pods_foo_description

result = Kube.ctl { annotate.pods.foo.description- }
assert_buffer(result, [["annotate", []], ["pods", []], ["foo", []], ["description", []], :dash])
assert_string(result, "annotate pods foo description-")

end



163
164
165
166
167
# File 'lib/kube/ctl/string_builder.rb', line 163

def test_kubectl_api_versions
  result = Kube.ctl { api-versions }
  assert_buffer(result, [["api", []], :dash, ["versions", []]])
  assert_string(result, "api-versions")
end

#test_kubectl_apply_edit_last_applied_deployment_nginxObject



187
188
189
190
191
# File 'lib/kube/ctl/string_builder.rb', line 187

def test_kubectl_apply_edit_last_applied_deployment_nginx
  result = Kube.ctl { apply.edit-last-applied.deployment/nginx }
  assert_buffer(result, [["apply", []], ["edit", []], :dash, ["last", []], :dash, ["applied", []], ["deployment", []], :slash, ["nginx", []]])
  assert_string(result, "apply edit-last-applied deployment/nginx")
end

#test_kubectl_apply_edit_last_applied_f_deploy_yaml_o_jsonObject



193
194
195
196
197
# File 'lib/kube/ctl/string_builder.rb', line 193

def test_kubectl_apply_edit_last_applied_f_deploy_yaml_o_json
  result = Kube.ctl { apply.edit-last-applied.f('deploy.yaml').o('json') }
  assert_buffer(result, [["apply", []], ["edit", []], :dash, ["last", []], :dash, ["applied", []], ["f", ["deploy.yaml"]], ["o", ["json"]]])
  assert_string(result, "apply edit-last-applied -f deploy.yaml -o json")
end

#test_kubectl_apply_f_pod_jsonObject



169
170
171
172
173
# File 'lib/kube/ctl/string_builder.rb', line 169

def test_kubectl_apply_f_pod_json
  result = Kube.ctl { apply.f './pod.json' }
  assert_buffer(result, [["apply", []], ["f", ["./pod.json"]]])
  assert_string(result, "apply -f ./pod.json")
end

#test_kubectl_apply_prune_f_manifest_yaml_all_prune_whitelist_core_v1_configmapObject



181
182
183
184
185
# File 'lib/kube/ctl/string_builder.rb', line 181

def test_kubectl_apply_prune_f_manifest_yaml_all_prune_whitelist_core_v1_configmap
  result = Kube.ctl { apply.prune(true).f('manifest.yaml').all(true).prune_whitelist('core/v1/ConfigMap') }
  assert_buffer(result, [["apply", []], ["prune", [true]], ["f", ["manifest.yaml"]], ["all", [true]], ["prune_whitelist", ["core/v1/ConfigMap"]]])
  assert_string(result, "apply --prune -f manifest.yaml --all --prune-whitelist=core/v1/ConfigMap")
end

#test_kubectl_apply_prune_f_manifest_yaml_l_app_nginxObject



175
176
177
178
179
# File 'lib/kube/ctl/string_builder.rb', line 175

def test_kubectl_apply_prune_f_manifest_yaml_l_app_nginx
  result = Kube.ctl { apply.prune(true).f('manifest.yaml').l(app: :nginx) }
  assert_buffer(result, [["apply", []], ["prune", [true]], ["f", ["manifest.yaml"]], ["l", [{app: :nginx}]]])
  assert_string(result, "apply --prune -f manifest.yaml -l app=nginx")
end

#test_kubectl_apply_set_last_applied_f_deploy_yamlObject



199
200
201
202
203
# File 'lib/kube/ctl/string_builder.rb', line 199

def test_kubectl_apply_set_last_applied_f_deploy_yaml
  result = Kube.ctl { apply.set-last-applied.f('deploy.yaml') }
  assert_buffer(result, [["apply", []], ["set", []], :dash, ["last", []], :dash, ["applied", []], ["f", ["deploy.yaml"]]])
  assert_string(result, "apply set-last-applied -f deploy.yaml")
end

#test_kubectl_apply_set_last_applied_f_deploy_yaml_create_annotation_trueObject



211
212
213
214
215
# File 'lib/kube/ctl/string_builder.rb', line 211

def test_kubectl_apply_set_last_applied_f_deploy_yaml_create_annotation_true
  result = Kube.ctl { apply.set-last-applied.f('deploy.yaml').create_annotation(true) }
  assert_buffer(result, [["apply", []], ["set", []], :dash, ["last", []], :dash, ["applied", []], ["f", ["deploy.yaml"]], ["create_annotation", [true]]])
  assert_string(result, "apply set-last-applied -f deploy.yaml --create-annotation")
end

#test_kubectl_apply_set_last_applied_f_pathObject



205
206
207
208
209
# File 'lib/kube/ctl/string_builder.rb', line 205

def test_kubectl_apply_set_last_applied_f_path
  result = Kube.ctl { apply.set-last-applied.f('path/') }
  assert_buffer(result, [["apply", []], ["set", []], :dash, ["last", []], :dash, ["applied", []], ["f", ["path/"]]])
  assert_string(result, "apply set-last-applied -f path/")
end

#test_kubectl_apply_view_last_applied_deployment_nginxObject



217
218
219
220
221
# File 'lib/kube/ctl/string_builder.rb', line 217

def test_kubectl_apply_view_last_applied_deployment_nginx
  result = Kube.ctl { apply.view-last-applied.deployment/nginx }
  assert_buffer(result, [["apply", []], ["view", []], :dash, ["last", []], :dash, ["applied", []], ["deployment", []], :slash, ["nginx", []]])
  assert_string(result, "apply view-last-applied deployment/nginx")
end

#test_kubectl_apply_view_last_applied_f_deploy_yaml_o_jsonObject



223
224
225
226
227
# File 'lib/kube/ctl/string_builder.rb', line 223

def test_kubectl_apply_view_last_applied_f_deploy_yaml_o_json
  result = Kube.ctl { apply.view-last-applied.f('deploy.yaml').o('json') }
  assert_buffer(result, [["apply", []], ["view", []], :dash, ["last", []], :dash, ["applied", []], ["f", ["deploy.yaml"]], ["o", ["json"]]])
  assert_string(result, "apply view-last-applied -f deploy.yaml -o json")
end

#test_kubectl_attach_rs_nginxObject

Skipped: numeric literal 123456-7890 is not valid Ruby syntax def test_kubectl_attach_123456_7890_c_ruby_container_i_t

result = Kube.ctl { attach.123456-7890.c('ruby-container').i(true).t(true) }
assert_buffer(result, [["attach", []], ["123456", []], :dash, ["7890", []], ["c", ["ruby-container"]], ["i", [true]], ["t", [true]]])
assert_string(result, "attach 123456-7890 -c ruby-container -i -t")

end



250
251
252
253
254
# File 'lib/kube/ctl/string_builder.rb', line 250

def test_kubectl_attach_rs_nginx
  result = Kube.ctl { attach.rs/nginx }
  assert_buffer(result, [["attach", []], ["rs", []], :slash, ["nginx", []]])
  assert_string(result, "attach rs/nginx")
end

#test_kubectl_auth_can_iObject



268
269
270
271
272
# File 'lib/kube/ctl/string_builder.rb', line 268

def test_kubectl_auth_can_i
  result = Kube.ctl { auth.can-i.('*').('*') }
  assert_buffer(result, [["auth", []], ["can", []], :dash, ["i", []], ["*", []], ["*", []]])
  assert_string(result, "auth can-i * *")
end

#test_kubectl_auth_can_i_create_pods_all_namespacesObject



256
257
258
259
260
# File 'lib/kube/ctl/string_builder.rb', line 256

def test_kubectl_auth_can_i_create_pods_all_namespaces
  result = Kube.ctl { auth.can-i.create.pods.all_namespaces(true) }
  assert_buffer(result, [["auth", []], ["can", []], :dash, ["i", []], ["create", []], ["pods", []], ["all_namespaces", [true]]])
  assert_string(result, "auth can-i create pods --all-namespaces")
end

#test_kubectl_auth_can_i_get_logsObject



286
287
288
289
290
# File 'lib/kube/ctl/string_builder.rb', line 286

def test_kubectl_auth_can_i_get_logs
  result = Kube.ctl { auth.can-i.get.('/logs/') }
  assert_buffer(result, [["auth", []], ["can", []], :dash, ["i", []], ["get", []], ["/logs/", []]])
  assert_string(result, "auth can-i get /logs/")
end

#test_kubectl_auth_can_i_get_pods_subresource_logObject



280
281
282
283
284
# File 'lib/kube/ctl/string_builder.rb', line 280

def test_kubectl_auth_can_i_get_pods_subresource_log
  result = Kube.ctl { auth.can-i.get.pods.subresource('log') }
  assert_buffer(result, [["auth", []], ["can", []], :dash, ["i", []], ["get", []], ["pods", []], ["subresource", ["log"]]])
  assert_string(result, "auth can-i get pods --subresource=log")
end

#test_kubectl_auth_can_i_list_deployments_extensionsObject



262
263
264
265
266
# File 'lib/kube/ctl/string_builder.rb', line 262

def test_kubectl_auth_can_i_list_deployments_extensions
  result = Kube.ctl { auth.can-i.list.deployments.extensions }
  assert_buffer(result, [["auth", []], ["can", []], :dash, ["i", []], ["list", []], ["deployments", []], ["extensions", []]])
  assert_string(result, "auth can-i list deployments extensions")
end

#test_kubectl_auth_can_i_list_jobs_batch_bar_n_fooObject



274
275
276
277
278
# File 'lib/kube/ctl/string_builder.rb', line 274

def test_kubectl_auth_can_i_list_jobs_batch_bar_n_foo
  result = Kube.ctl { auth.can-i.list.jobs.batch/bar.n('foo') }
  assert_buffer(result, [["auth", []], ["can", []], :dash, ["i", []], ["list", []], ["jobs", []], ["batch", []], :slash, ["bar", []], ["n", ["foo"]]])
  assert_string(result, "auth can-i list jobs batch/bar -n foo")
end

#test_kubectl_autoscale_deployment_foo_min_2_max_10Object



292
293
294
295
296
# File 'lib/kube/ctl/string_builder.rb', line 292

def test_kubectl_autoscale_deployment_foo_min_2_max_10
  result = Kube.ctl { autoscale.deployment.foo.min(2).max(10) }
  assert_buffer(result, [["autoscale", []], ["deployment", []], ["foo", []], ["min", [2]], ["max", [10]]])
  assert_string(result, "autoscale deployment foo --min=2 --max=10")
end

#test_kubectl_autoscale_rc_foo_max_5_cpu_percent_80Object



298
299
300
301
302
# File 'lib/kube/ctl/string_builder.rb', line 298

def test_kubectl_autoscale_rc_foo_max_5_cpu_percent_80
  result = Kube.ctl { autoscale.rc.foo.max(5).cpu_percent(80) }
  assert_buffer(result, [["autoscale", []], ["rc", []], ["foo", []], ["max", [5]], ["cpu_percent", [80]]])
  assert_string(result, "autoscale rc foo --max=5 --cpu-percent=80")
end

#test_kubectl_cluster_infoObject



304
305
306
307
308
# File 'lib/kube/ctl/string_builder.rb', line 304

def test_kubectl_cluster_info
  result = Kube.ctl { cluster-info }
  assert_buffer(result, [["cluster", []], :dash, ["info", []]])
  assert_string(result, "cluster-info")
end

#test_kubectl_cluster_info_dumpObject



310
311
312
313
314
# File 'lib/kube/ctl/string_builder.rb', line 310

def test_kubectl_cluster_info_dump
  result = Kube.ctl { cluster-info.dump }
  assert_buffer(result, [["cluster", []], :dash, ["info", []], ["dump", []]])
  assert_string(result, "cluster-info dump")
end

#test_kubectl_cluster_info_dump_all_namespacesObject



322
323
324
325
326
# File 'lib/kube/ctl/string_builder.rb', line 322

def test_kubectl_cluster_info_dump_all_namespaces
  result = Kube.ctl { cluster-info.dump.all_namespaces(true) }
  assert_buffer(result, [["cluster", []], :dash, ["info", []], ["dump", []], ["all_namespaces", [true]]])
  assert_string(result, "cluster-info dump --all-namespaces")
end

#test_kubectl_cluster_info_dump_namespaces_default_kube_system_output_directory_path_to_cluster_stateObject



328
329
330
331
332
# File 'lib/kube/ctl/string_builder.rb', line 328

def test_kubectl_cluster_info_dump_namespaces_default_kube_system_output_directory_path_to_cluster_state
  result = Kube.ctl { cluster-info.dump.namespaces('default', 'kube-system').output_directory('/path/to/cluster-state')}
  assert_buffer(result, [["cluster", []], :dash, ["info", []], ["dump", []], ["namespaces", ["default", "kube-system"]], ["output_directory", ["/path/to/cluster-state"]]])
  assert_string(result, "cluster-info dump --namespaces=default,kube-system --output-directory=/path/to/cluster-state")
end

#test_kubectl_cluster_info_dump_output_directory_path_to_cluster_stateObject



316
317
318
319
320
# File 'lib/kube/ctl/string_builder.rb', line 316

def test_kubectl_cluster_info_dump_output_directory_path_to_cluster_state
  result = Kube.ctl { cluster-info.dump.output_directory('/path/to/cluster-state') }
  assert_buffer(result, [["cluster", []], :dash, ["info", []], ["dump", []], ["output_directory", ["/path/to/cluster-state"]]])
  assert_string(result, "cluster-info dump --output-directory=/path/to/cluster-state")
end

#test_kubectl_config_current_contextObject



334
335
336
337
338
# File 'lib/kube/ctl/string_builder.rb', line 334

def test_kubectl_config_current_context
  result = Kube.ctl { config.current-context }
  assert_buffer(result, [["config", []], ["current", []], :dash, ["context", []]])
  assert_string(result, "config current-context")
end

#test_kubectl_config_delete_cluster_minikubeObject



340
341
342
343
344
# File 'lib/kube/ctl/string_builder.rb', line 340

def test_kubectl_config_delete_cluster_minikube
  result = Kube.ctl { config.delete-cluster.minikube }
  assert_buffer(result, [["config", []], ["delete", []], :dash, ["cluster", []], ["minikube", []]])
  assert_string(result, "config delete-cluster minikube")
end

#test_kubectl_config_delete_context_minikubeObject



346
347
348
349
350
# File 'lib/kube/ctl/string_builder.rb', line 346

def test_kubectl_config_delete_context_minikube
  result = Kube.ctl { config.delete-context.minikube }
  assert_buffer(result, [["config", []], ["delete", []], :dash, ["context", []], ["minikube", []]])
  assert_string(result, "config delete-context minikube")
end

#test_kubectl_config_get_clustersObject



352
353
354
355
356
# File 'lib/kube/ctl/string_builder.rb', line 352

def test_kubectl_config_get_clusters
  result = Kube.ctl { config.get-clusters }
  assert_buffer(result, [["config", []], ["get", []], :dash, ["clusters", []]])
  assert_string(result, "config get-clusters")
end

#test_kubectl_config_get_contextsObject



358
359
360
361
362
# File 'lib/kube/ctl/string_builder.rb', line 358

def test_kubectl_config_get_contexts
  result = Kube.ctl { config.get-contexts }
  assert_buffer(result, [["config", []], ["get", []], :dash, ["contexts", []]])
  assert_string(result, "config get-contexts")
end

#test_kubectl_config_get_contexts_my_contextObject



364
365
366
367
368
# File 'lib/kube/ctl/string_builder.rb', line 364

def test_kubectl_config_get_contexts_my_context
  result = Kube.ctl { config.get-contexts.my-context }
  assert_buffer(result, [["config", []], ["get", []], :dash, ["contexts", []], ["my", []], :dash, ["context", []]])
  assert_string(result, "config get-contexts my-context")
end

#test_kubectl_config_rename_context_old_name_new_nameObject



370
371
372
373
374
# File 'lib/kube/ctl/string_builder.rb', line 370

def test_kubectl_config_rename_context_old_name_new_name
  result = Kube.ctl { config.rename-context.old-name.new-name }
  assert_buffer(result, [["config", []], ["rename", []], :dash, ["context", []], ["old", []], :dash, ["name", []], ["new", []], :dash, ["name", []]])
  assert_string(result, "config rename-context old-name new-name")
end

#test_kubectl_config_set_cluster_e2e_certificate_authority_kube_e2e_kubernetes_ca_crtObject



382
383
384
385
386
# File 'lib/kube/ctl/string_builder.rb', line 382

def test_kubectl_config_set_cluster_e2e_certificate_authority_kube_e2e_kubernetes_ca_crt
  result = Kube.ctl { config.set-cluster.e2e.cluster_authority('~/.kube/e2e/kubernetes.ca.crt')}
  assert_buffer(result, [["config", []], ["set", []], :dash, ["cluster", []], ["e2e", []], ["cluster_authority", ["~/.kube/e2e/kubernetes.ca.crt"]]])
  assert_string(result, "config set-cluster e2e --cluster-authority=~/.kube/e2e/kubernetes.ca.crt")
end

#test_kubectl_config_set_cluster_e2e_insecure_skip_tls_verify_trueObject



388
389
390
391
392
# File 'lib/kube/ctl/string_builder.rb', line 388

def test_kubectl_config_set_cluster_e2e_insecure_skip_tls_verify_true
  result = Kube.ctl { config.set-cluster.e2e.insecure_skip_tls_verify(true) }
  assert_buffer(result, [["config", []], ["set", []], :dash, ["cluster", []], ["e2e", []], ["insecure_skip_tls_verify", [true]]])
  assert_string(result, "config set-cluster e2e --insecure-skip-tls-verify")
end

#test_kubectl_config_set_cluster_e2e_server_https_1_2_3_4Object



376
377
378
379
380
# File 'lib/kube/ctl/string_builder.rb', line 376

def test_kubectl_config_set_cluster_e2e_server_https_1_2_3_4
  result = Kube.ctl { config.set-cluster.e2e.server('https://1.2.3.4') }
  assert_buffer(result, [["config", []], ["set", []], :dash, ["cluster", []], ["e2e", []], ["server", ["https://1.2.3.4"]]])
  assert_string(result, "config set-cluster e2e --server=https://1.2.3.4")
end

#test_kubectl_config_set_context_gce_user_cluster_adminObject



394
395
396
397
398
# File 'lib/kube/ctl/string_builder.rb', line 394

def test_kubectl_config_set_context_gce_user_cluster_admin
  result = Kube.ctl { config.set-context.gce.user('cluster-admin') }
  assert_buffer(result, [["config", []], ["set", []], :dash, ["context", []], ["gce", []], ["user", ["cluster-admin"]]])
  assert_string(result, "config set-context gce --user=cluster-admin")
end

#test_kubectl_config_set_credentials_cluster_admin_auth_provider_gcpObject



418
419
420
421
422
# File 'lib/kube/ctl/string_builder.rb', line 418

def test_kubectl_config_set_credentials_cluster_admin_auth_provider_gcp
  result = Kube.ctl { config.set-credentials.cluster-admin.auth_provider('gcp') }
  assert_buffer(result, [["config", []], ["set", []], :dash, ["credentials", []], ["cluster", []], :dash, ["admin", []], ["auth_provider", ["gcp"]]])
  assert_string(result, "config set-credentials cluster-admin --auth-provider=gcp")
end

#test_kubectl_config_set_credentials_cluster_admin_auth_provider_oidc_auth_provider_arg_client_id_foo_auth_provider_arg_client_secret_barObject



424
425
426
427
428
# File 'lib/kube/ctl/string_builder.rb', line 424

def test_kubectl_config_set_credentials_cluster_admin_auth_provider_oidc_auth_provider_arg_client_id_foo_auth_provider_arg_client_secret_bar
  result = Kube.ctl { config.set-credentials.cluster-admin.auth_provider('oidc').auth_provider_arg('client-id=foo').auth_provider_arg('client-secret=bar') }
  assert_buffer(result, [["config", []], ["set", []], :dash, ["credentials", []], ["cluster", []], :dash, ["admin", []], ["auth_provider", ["oidc"]], ["auth_provider_arg", ["client-id=foo"]], ["auth_provider_arg", ["client-secret=bar"]]])
  assert_string(result, "config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-id=foo --auth-provider-arg=client-secret=bar")
end

#test_kubectl_config_set_credentials_cluster_admin_auth_provider_oidc_auth_provider_arg_client_secretObject



430
431
432
433
434
# File 'lib/kube/ctl/string_builder.rb', line 430

def test_kubectl_config_set_credentials_cluster_admin_auth_provider_oidc_auth_provider_arg_client_secret
  result = Kube.ctl { config.set-credentials.cluster-admin.auth_provider('oidc').auth_provider_arg('client-secret-') }
  assert_buffer(result, [["config", []], ["set", []], :dash, ["credentials", []], ["cluster", []], :dash, ["admin", []], ["auth_provider", ["oidc"]], ["auth_provider_arg", ["client-secret-"]]])
  assert_string(result, "config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-secret-")
end

#test_kubectl_config_set_credentials_cluster_admin_client_certificate_kube_admin_crt_embed_certs_trueObject



412
413
414
415
416
# File 'lib/kube/ctl/string_builder.rb', line 412

def test_kubectl_config_set_credentials_cluster_admin_client_certificate_kube_admin_crt_embed_certs_true
  result = Kube.ctl { config.set-credentials.cluster-admin.client_certificate('~/.kube/admin.crt').embed_certs(true) }
  assert_buffer(result, [["config", []], ["set", []], :dash, ["credentials", []], ["cluster", []], :dash, ["admin", []], ["client_certificate", ["~/.kube/admin.crt"]], ["embed_certs", [true]]])
  assert_string(result, "config set-credentials cluster-admin --client-certificate=~/.kube/admin.crt --embed-certs")
end

#test_kubectl_config_set_credentials_cluster_admin_client_key_kube_admin_keyObject



400
401
402
403
404
# File 'lib/kube/ctl/string_builder.rb', line 400

def test_kubectl_config_set_credentials_cluster_admin_client_key_kube_admin_key
  result = Kube.ctl { config.set-credentials.cluster-admin.client_key('~/.kube/admin.key') }
  assert_buffer(result, [["config", []], ["set", []], :dash, ["credentials", []], ["cluster", []], :dash, ["admin", []], ["client_key", ["~/.kube/admin.key"]]])
  assert_string(result, "config set-credentials cluster-admin --client-key=~/.kube/admin.key")
end

#test_kubectl_config_set_credentials_cluster_admin_username_admin_password_uxfgweu9l35qcifObject



406
407
408
409
410
# File 'lib/kube/ctl/string_builder.rb', line 406

def test_kubectl_config_set_credentials_cluster_admin_username_admin_password_uxfgweu9l35qcif
  result = Kube.ctl { config.set-credentials.cluster-admin.username('admin').password('uXFGweU9l35qcif') }
  assert_buffer(result, [["config", []], ["set", []], :dash, ["credentials", []], ["cluster", []], :dash, ["admin", []], ["username", ["admin"]], ["password", ["uXFGweU9l35qcif"]]])
  assert_string(result, "config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif")
end

#test_kubectl_config_use_context_minikubeObject



436
437
438
439
440
# File 'lib/kube/ctl/string_builder.rb', line 436

def test_kubectl_config_use_context_minikube
  result = Kube.ctl { config.use-context.minikube }
  assert_buffer(result, [["config", []], ["use", []], :dash, ["context", []], ["minikube", []]])
  assert_string(result, "config use-context minikube")
end

#test_kubectl_config_viewObject



442
443
444
445
446
# File 'lib/kube/ctl/string_builder.rb', line 442

def test_kubectl_config_view
  result = Kube.ctl { config.view }
  assert_buffer(result, [["config", []], ["view", []]])
  assert_string(result, "config view")
end

#test_kubectl_config_view_o_jsonpath_users_name_e2e_user_passwordObject



448
449
450
451
452
# File 'lib/kube/ctl/string_builder.rb', line 448

def test_kubectl_config_view_o_jsonpath_users_name_e2e_user_password
  result = Kube.ctl { config.view.o("jsonpath": "'{.users[?(@.name == \"e2e\")].user.password}'")}
  assert_buffer(result, [["config", []], ["view", []], ["o", [{jsonpath: "'{.users[?(@.name == \"e2e\")].user.password}'"}]]])
  assert_string(result, "config view -o jsonpath='{.users[?(@.name == \"e2e\")].user.password}'")
end

#test_kubectl_convert_f_pod_yamlObject



454
455
456
457
458
# File 'lib/kube/ctl/string_builder.rb', line 454

def test_kubectl_convert_f_pod_yaml
  result = Kube.ctl { convert.f('pod.yaml') }
  assert_buffer(result, [["convert", []], ["f", ["pod.yaml"]]])
  assert_string(result, "convert -f pod.yaml")
end

#test_kubectl_convert_f_pod_yaml_local_o_jsonObject



460
461
462
463
464
# File 'lib/kube/ctl/string_builder.rb', line 460

def test_kubectl_convert_f_pod_yaml_local_o_json
  result = Kube.ctl { convert.f('pod.yaml').local(true).o('json') }
  assert_buffer(result, [["convert", []], ["f", ["pod.yaml"]], ["local", [true]], ["o", ["json"]]])
  assert_string(result, "convert -f pod.yaml --local -o json")
end

#test_kubectl_cordon_fooObject



466
467
468
469
470
# File 'lib/kube/ctl/string_builder.rb', line 466

def test_kubectl_cordon_foo
  result = Kube.ctl { cordon.foo }
  assert_buffer(result, [["cordon", []], ["foo", []]])
  assert_string(result, "cordon foo")
end

#test_kubectl_cp_some_namespace_some_pod_tmp_foo_tmp_barObject



484
485
486
487
488
# File 'lib/kube/ctl/string_builder.rb', line 484

def test_kubectl_cp_some_namespace_some_pod_tmp_foo_tmp_bar
  result = Kube.ctl { cp.('<some-namespace>/<some-pod>:/tmp/foo').('/tmp/bar')}
  assert_buffer(result, [["cp", []], ["<some-namespace>/<some-pod>:/tmp/foo", []], ["/tmp/bar", []]])
  assert_string(result, "cp <some-namespace>/<some-pod>:/tmp/foo /tmp/bar")
end

#test_kubectl_cp_tmp_foo_some_namespace_some_pod_tmp_barObject



478
479
480
481
482
# File 'lib/kube/ctl/string_builder.rb', line 478

def test_kubectl_cp_tmp_foo_some_namespace_some_pod_tmp_bar
  result = Kube.ctl { cp.('/tmp/foo').('<some-namespace>/<some-pod>:/tmp/bar')}
  assert_buffer(result, [["cp", []], ["/tmp/foo", []], ["<some-namespace>/<some-pod>:/tmp/bar", []]])
  assert_string(result, "cp /tmp/foo <some-namespace>/<some-pod>:/tmp/bar")
end

#test_kubectl_cp_tmp_foo_some_pod_tmp_bar_c_specific_containerObject



472
473
474
475
476
# File 'lib/kube/ctl/string_builder.rb', line 472

def test_kubectl_cp_tmp_foo_some_pod_tmp_bar_c_specific_container
  result = Kube.ctl { cp.('/tmp/foo').('<some-pod>:/tmp/bar').c('<specific-container>')}
  assert_buffer(result, [["cp", []], ["/tmp/foo", []], ["<some-pod>:/tmp/bar", []], ["c", ["<specific-container>"]]])
  assert_string(result, "cp /tmp/foo <some-pod>:/tmp/bar -c <specific-container>")
end

#test_kubectl_create_clusterrole_foo_verb_get_list_watch_resource_pods_pods_statusObject



520
521
522
523
524
# File 'lib/kube/ctl/string_builder.rb', line 520

def test_kubectl_create_clusterrole_foo_verb_get_list_watch_resource_pods_pods_status
  result = Kube.ctl { create.clusterrole.foo.verb(:get, :list, :watch).resource(:pods, 'pods/status') }
  assert_buffer(result, [["create", []], ["clusterrole", []], ["foo", []], ["verb", [:get, :list, :watch]], ["resource", [:pods, "pods/status"]]])
  assert_string(result, "create clusterrole foo --verb=get,list,watch --resource=pods,pods/status")
end

#test_kubectl_create_clusterrole_foo_verb_get_list_watch_resource_rs_extensionsObject



514
515
516
517
518
# File 'lib/kube/ctl/string_builder.rb', line 514

def test_kubectl_create_clusterrole_foo_verb_get_list_watch_resource_rs_extensions
  result = Kube.ctl { create.clusterrole.foo.verb(:get, :list, :watch).resource('rs.extensions') }
  assert_buffer(result, [["create", []], ["clusterrole", []], ["foo", []], ["verb", [:get, :list, :watch]], ["resource", ["rs.extensions"]]])
  assert_string(result, "create clusterrole foo --verb=get,list,watch --resource=rs.extensions")
end

#test_kubectl_create_clusterrole_foo_verb_get_non_resource_url_logsObject



526
527
528
529
530
# File 'lib/kube/ctl/string_builder.rb', line 526

def test_kubectl_create_clusterrole_foo_verb_get_non_resource_url_logs
  result = Kube.ctl { create.clusterrole.('"foo"').verb(:get).non_resource_url('/logs/*') }
  assert_buffer(result, [["create", []], ["clusterrole", []], ["\"foo\"", []], ["verb", [:get]], ["non_resource_url", ["/logs/*"]]])
  assert_string(result, "create clusterrole \"foo\" --verb=get --non-resource-url=/logs/*")
end

#test_kubectl_create_clusterrole_pod_reader_verb_get_list_watch_resource_podsObject



502
503
504
505
506
# File 'lib/kube/ctl/string_builder.rb', line 502

def test_kubectl_create_clusterrole_pod_reader_verb_get_list_watch_resource_pods
  result = Kube.ctl { create.clusterrole.pod-reader.verb(:get, :list, :watch).resource(:pods)}
  assert_buffer(result, [["create", []], ["clusterrole", []], ["pod", []], :dash, ["reader", []], ["verb", [:get, :list, :watch]], ["resource", [:pods]]])
  assert_string(result, "create clusterrole pod-reader --verb=get,list,watch --resource=pods")
end

#test_kubectl_create_clusterrole_pod_reader_verb_get_list_watch_resource_pods_resource_name_readablepod_resource_name_anotherpodObject



508
509
510
511
512
# File 'lib/kube/ctl/string_builder.rb', line 508

def test_kubectl_create_clusterrole_pod_reader_verb_get_list_watch_resource_pods_resource_name_readablepod_resource_name_anotherpod
  result = Kube.ctl { create.clusterrole.pod-reader.verb(:get, :list, :watch).resource(:pods).resource_name(:readablepod).resource_name(:anotherpod) }
  assert_buffer(result, [["create", []], ["clusterrole", []], ["pod", []], :dash, ["reader", []], ["verb", [:get, :list, :watch]], ["resource", [:pods]], ["resource_name", [:readablepod]], ["resource_name", [:anotherpod]]])
  assert_string(result, "create clusterrole pod-reader --verb=get,list,watch --resource=pods --resource-name=readablepod --resource-name=anotherpod")
end

#test_kubectl_create_clusterrolebinding_cluster_admin_clusterrole_cluster_admin_user_user1_user_user2_group_group1Object



532
533
534
535
536
# File 'lib/kube/ctl/string_builder.rb', line 532

def test_kubectl_create_clusterrolebinding_cluster_admin_clusterrole_cluster_admin_user_user1_user_user2_group_group1
  result = Kube.ctl { create.clusterrolebinding.cluster-admin.clusterrole('cluster-admin').user('user1').user('user2').group('group1') }
  assert_buffer(result, [["create", []], ["clusterrolebinding", []], ["cluster", []], :dash, ["admin", []], ["clusterrole", ["cluster-admin"]], ["user", ["user1"]], ["user", ["user2"]], ["group", ["group1"]]])
  assert_string(result, "create clusterrolebinding cluster-admin --clusterrole=cluster-admin --user=user1 --user=user2 --group=group1")
end

#test_kubectl_create_configmap_my_config_from_env_file_path_to_bar_envObject



556
557
558
559
560
# File 'lib/kube/ctl/string_builder.rb', line 556

def test_kubectl_create_configmap_my_config_from_env_file_path_to_bar_env
  result = Kube.ctl { create.configmap.my-config.from_env_file('path/to/bar.env') }
  assert_buffer(result, [["create", []], ["configmap", []], ["my", []], :dash, ["config", []], ["from_env_file", ["path/to/bar.env"]]])
  assert_string(result, "create configmap my-config --from-env-file=path/to/bar.env")
end

#test_kubectl_create_configmap_my_config_from_file_key1_path_to_bar_file1_txt_from_file_key2_path_to_bar_file2_txtObject



544
545
546
547
548
# File 'lib/kube/ctl/string_builder.rb', line 544

def test_kubectl_create_configmap_my_config_from_file_key1_path_to_bar_file1_txt_from_file_key2_path_to_bar_file2_txt
  result = Kube.ctl { create.configmap.my-config.from_file('key1=/path/to/bar/file1.txt').from_file('key2=/path/to/bar/file2.txt') }
  assert_buffer(result, [["create", []], ["configmap", []], ["my", []], :dash, ["config", []], ["from_file", ["key1=/path/to/bar/file1.txt"]], ["from_file", ["key2=/path/to/bar/file2.txt"]]])
  assert_string(result, "create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt")
end

#test_kubectl_create_configmap_my_config_from_file_path_to_barObject



538
539
540
541
542
# File 'lib/kube/ctl/string_builder.rb', line 538

def test_kubectl_create_configmap_my_config_from_file_path_to_bar
  result = Kube.ctl { create.configmap.my-config.from_file('path/to/bar') }
  assert_buffer(result, [["create", []], ["configmap", []], ["my", []], :dash, ["config", []], ["from_file", ["path/to/bar"]]])
  assert_string(result, "create configmap my-config --from-file=path/to/bar")
end

#test_kubectl_create_configmap_my_config_from_literal_key1_config1_from_literal_key2_config2Object



550
551
552
553
554
# File 'lib/kube/ctl/string_builder.rb', line 550

def test_kubectl_create_configmap_my_config_from_literal_key1_config1_from_literal_key2_config2
  result = Kube.ctl { create.configmap.my-config.from_literal('key1=config1').from_literal('key2=config2') }
  assert_buffer(result, [["create", []], ["configmap", []], ["my", []], :dash, ["config", []], ["from_literal", ["key1=config1"]], ["from_literal", ["key2=config2"]]])
  assert_string(result, "create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2")
end

#test_kubectl_create_deployment_my_dep_image_busyboxObject



562
563
564
565
566
# File 'lib/kube/ctl/string_builder.rb', line 562

def test_kubectl_create_deployment_my_dep_image_busybox
  result = Kube.ctl { create.deployment.my-dep.image(:busybox) }
  assert_buffer(result, [["create", []], ["deployment", []], ["my", []], :dash, ["dep", []], ["image", [:busybox]]])
  assert_string(result, "create deployment my-dep --image=busybox")
end

#test_kubectl_create_f_docker_registry_yaml_edit_output_version_v1_o_jsonObject



496
497
498
499
500
# File 'lib/kube/ctl/string_builder.rb', line 496

def test_kubectl_create_f_docker_registry_yaml_edit_output_version_v1_o_json
  result = Kube.ctl { create.f('docker-registry.yaml').edit(true).output_version('v1').o('json') }
  assert_buffer(result, [["create", []], ["f", ["docker-registry.yaml"]], ["edit", [true]], ["output_version", ["v1"]], ["o", ["json"]]])
  assert_string(result, "create -f docker-registry.yaml --edit --output-version=v1 -o json")
end

#test_kubectl_create_f_pod_jsonObject



490
491
492
493
494
# File 'lib/kube/ctl/string_builder.rb', line 490

def test_kubectl_create_f_pod_json
  result = Kube.ctl { create.f './pod.json' }
  assert_buffer(result, [["create", []], ["f", ["./pod.json"]]])
  assert_string(result, "create -f ./pod.json")
end

#test_kubectl_create_namespace_my_namespaceObject



568
569
570
571
572
# File 'lib/kube/ctl/string_builder.rb', line 568

def test_kubectl_create_namespace_my_namespace
  result = Kube.ctl { create.namespace.my-namespace }
  assert_buffer(result, [["create", []], ["namespace", []], ["my", []], :dash, ["namespace", []]])
  assert_string(result, "create namespace my-namespace")
end

#test_kubectl_create_pdb_my_pdb_selector_app_nginx_min_available_50Object



580
581
582
583
584
# File 'lib/kube/ctl/string_builder.rb', line 580

def test_kubectl_create_pdb_my_pdb_selector_app_nginx_min_available_50
  result = Kube.ctl { create.pdb.my-pdb.selector('app=nginx').min_available('50%') }
  assert_buffer(result, [["create", []], ["pdb", []], ["my", []], :dash, ["pdb", []], ["selector", ["app=nginx"]], ["min_available", ["50%"]]])
  assert_string(result, "create pdb my-pdb --selector=app=nginx --min-available=50%")
end

#test_kubectl_create_poddisruptionbudget_my_pdb_selector_app_rails_min_available_1Object



574
575
576
577
578
# File 'lib/kube/ctl/string_builder.rb', line 574

def test_kubectl_create_poddisruptionbudget_my_pdb_selector_app_rails_min_available_1
  result = Kube.ctl { create.poddisruptionbudget.my-pdb.selector('app=rails').min_available(1) }
  assert_buffer(result, [["create", []], ["poddisruptionbudget", []], ["my", []], :dash, ["pdb", []], ["selector", ["app=rails"]], ["min_available", [1]]])
  assert_string(result, "create poddisruptionbudget my-pdb --selector=app=rails --min-available=1")
end

#test_kubectl_create_quota_best_effort_hard_pods_100_scopes_besteffortObject



592
593
594
595
596
# File 'lib/kube/ctl/string_builder.rb', line 592

def test_kubectl_create_quota_best_effort_hard_pods_100_scopes_besteffort
  result = Kube.ctl { create.quota.best-effort.hard('pods=100').scopes('BestEffort') }
  assert_buffer(result, [["create", []], ["quota", []], ["best", []], :dash, ["effort", []], ["hard", ["pods=100"]], ["scopes", ["BestEffort"]]])
  assert_string(result, "create quota best-effort --hard=pods=100 --scopes=BestEffort")
end

#test_kubectl_create_quota_my_quota_hard_cpu_1_memory_1g_pods_2_services_3_replicationcontrollers_2_resourcequotas_1_secrets_5_persistentvolumeclaims_10Object



586
587
588
589
590
# File 'lib/kube/ctl/string_builder.rb', line 586

def test_kubectl_create_quota_my_quota_hard_cpu_1_memory_1g_pods_2_services_3_replicationcontrollers_2_resourcequotas_1_secrets_5_persistentvolumeclaims_10
  result = Kube.ctl { create.quota.my-quota.hard('cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10') }
  assert_buffer(result, [["create", []], ["quota", []], ["my", []], :dash, ["quota", []], ["hard", ["cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10"]]])
  assert_string(result, "create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10")
end

#test_kubectl_create_role_foo_verb_get_list_watch_resource_pods_pods_statusObject



616
617
618
619
620
# File 'lib/kube/ctl/string_builder.rb', line 616

def test_kubectl_create_role_foo_verb_get_list_watch_resource_pods_pods_status
  result = Kube.ctl { create.role.foo.verb(:get, :list, :watch).resource(:pods, 'pods/status') }
  assert_buffer(result, [["create", []], ["role", []], ["foo", []], ["verb", [:get, :list, :watch]], ["resource", [:pods, "pods/status"]]])
  assert_string(result, "create role foo --verb=get,list,watch --resource=pods,pods/status")
end

#test_kubectl_create_role_foo_verb_get_list_watch_resource_rs_extensionsObject



610
611
612
613
614
# File 'lib/kube/ctl/string_builder.rb', line 610

def test_kubectl_create_role_foo_verb_get_list_watch_resource_rs_extensions
  result = Kube.ctl { create.role.foo.verb(:get, :list, :watch).resource('rs.extensions') }
  assert_buffer(result, [["create", []], ["role", []], ["foo", []], ["verb", [:get, :list, :watch]], ["resource", ["rs.extensions"]]])
  assert_string(result, "create role foo --verb=get,list,watch --resource=rs.extensions")
end

#test_kubectl_create_role_pod_reader_verb_get_list_watch_resource_pods_resource_name_readablepod_resource_name_anotherpodObject



604
605
606
607
608
# File 'lib/kube/ctl/string_builder.rb', line 604

def test_kubectl_create_role_pod_reader_verb_get_list_watch_resource_pods_resource_name_readablepod_resource_name_anotherpod
  result = Kube.ctl { create.role.pod-reader.verb(:get, :list, :watch).resource(:pods).resource_name(:readablepod).resource_name(:anotherpod) }
  assert_buffer(result, [["create", []], ["role", []], ["pod", []], :dash, ["reader", []], ["verb", [:get, :list, :watch]], ["resource", [:pods]], ["resource_name", [:readablepod]], ["resource_name", [:anotherpod]]])
  assert_string(result, "create role pod-reader --verb=get,list,watch --resource=pods --resource-name=readablepod --resource-name=anotherpod")
end

#test_kubectl_create_role_pod_reader_verb_get_verb_list_verb_watch_resource_podsObject



598
599
600
601
602
# File 'lib/kube/ctl/string_builder.rb', line 598

def test_kubectl_create_role_pod_reader_verb_get_verb_list_verb_watch_resource_pods
  result = Kube.ctl { create.role.pod-reader.verb(:get).verb(:list).verb(:watch).resource(:pods) }
  assert_buffer(result, [["create", []], ["role", []], ["pod", []], :dash, ["reader", []], ["verb", [:get]], ["verb", [:list]], ["verb", [:watch]], ["resource", [:pods]]])
  assert_string(result, "create role pod-reader --verb=get --verb=list --verb=watch --resource=pods")
end

#test_kubectl_create_rolebinding_admin_clusterrole_admin_user_user1_user_user2_group_group1Object



622
623
624
625
626
# File 'lib/kube/ctl/string_builder.rb', line 622

def test_kubectl_create_rolebinding_admin_clusterrole_admin_user_user1_user_user2_group_group1
  result = Kube.ctl { create.rolebinding.admin.clusterrole(:admin).user('user1').user('user2').group('group1') }
  assert_buffer(result, [["create", []], ["rolebinding", []], ["admin", []], ["clusterrole", [:admin]], ["user", ["user1"]], ["user", ["user2"]], ["group", ["group1"]]])
  assert_string(result, "create rolebinding admin --clusterrole=admin --user=user1 --user=user2 --group=group1")
end

#test_kubectl_create_secret_docker_registry_my_secret_docker_server_docker_registry_server_docker_username_docker_user_docker_password_docker_password_docker_email_docker_emailObject



628
629
630
631
632
# File 'lib/kube/ctl/string_builder.rb', line 628

def test_kubectl_create_secret_docker_registry_my_secret_docker_server_docker_registry_server_docker_username_docker_user_docker_password_docker_password_docker_email_docker_email
  result = Kube.ctl { create.secret.docker-registry.my-secret.docker_server('DOCKER_REGISTRY_SERVER').docker_username('DOCKER_USER').docker_password('DOCKER_PASSWORD').docker_email('DOCKER_EMAIL') }
  assert_buffer(result, [["create", []], ["secret", []], ["docker", []], :dash, ["registry", []], ["my", []], :dash, ["secret", []], ["docker_server", ["DOCKER_REGISTRY_SERVER"]], ["docker_username", ["DOCKER_USER"]], ["docker_password", ["DOCKER_PASSWORD"]], ["docker_email", ["DOCKER_EMAIL"]]])
  assert_string(result, "create secret docker-registry my-secret --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL")
end

#test_kubectl_create_secret_generic_my_secret_from_env_file_path_to_bar_envObject



652
653
654
655
656
# File 'lib/kube/ctl/string_builder.rb', line 652

def test_kubectl_create_secret_generic_my_secret_from_env_file_path_to_bar_env
  result = Kube.ctl { create.secret.generic.my-secret.from_env_file('path/to/bar.env') }
  assert_buffer(result, [["create", []], ["secret", []], ["generic", []], ["my", []], :dash, ["secret", []], ["from_env_file", ["path/to/bar.env"]]])
  assert_string(result, "create secret generic my-secret --from-env-file=path/to/bar.env")
end

#test_kubectl_create_secret_generic_my_secret_from_file_path_to_barObject



634
635
636
637
638
# File 'lib/kube/ctl/string_builder.rb', line 634

def test_kubectl_create_secret_generic_my_secret_from_file_path_to_bar
  result = Kube.ctl { create.secret.generic.my-secret.from_file('path/to/bar') }
  assert_buffer(result, [["create", []], ["secret", []], ["generic", []], ["my", []], :dash, ["secret", []], ["from_file", ["path/to/bar"]]])
  assert_string(result, "create secret generic my-secret --from-file=path/to/bar")
end

#test_kubectl_create_secret_generic_my_secret_from_file_ssh_privatekey_ssh_id_rsa_from_file_ssh_publickey_ssh_id_rsa_pubObject



640
641
642
643
644
# File 'lib/kube/ctl/string_builder.rb', line 640

def test_kubectl_create_secret_generic_my_secret_from_file_ssh_privatekey_ssh_id_rsa_from_file_ssh_publickey_ssh_id_rsa_pub
  result = Kube.ctl { create.secret.generic.my-secret.from_file('ssh-privatekey=~/.ssh/id_rsa').from_file('ssh-publickey=~/.ssh/id_rsa.pub') }
  assert_buffer(result, [["create", []], ["secret", []], ["generic", []], ["my", []], :dash, ["secret", []], ["from_file", ["ssh-privatekey=~/.ssh/id_rsa"]], ["from_file", ["ssh-publickey=~/.ssh/id_rsa.pub"]]])
  assert_string(result, "create secret generic my-secret --from-file=ssh-privatekey=~/.ssh/id_rsa --from-file=ssh-publickey=~/.ssh/id_rsa.pub")
end

#test_kubectl_create_secret_generic_my_secret_from_literal_key1_supersecret_from_literal_key2_topsecretObject



646
647
648
649
650
# File 'lib/kube/ctl/string_builder.rb', line 646

def test_kubectl_create_secret_generic_my_secret_from_literal_key1_supersecret_from_literal_key2_topsecret
  result = Kube.ctl { create.secret.generic.my-secret.from_literal('key1=supersecret').from_literal('key2=topsecret') }
  assert_buffer(result, [["create", []], ["secret", []], ["generic", []], ["my", []], :dash, ["secret", []], ["from_literal", ["key1=supersecret"]], ["from_literal", ["key2=topsecret"]]])
  assert_string(result, "create secret generic my-secret --from-literal=key1=supersecret --from-literal=key2=topsecret")
end

#test_kubectl_create_secret_tls_tls_secret_cert_path_to_tls_cert_key_path_to_tls_keyObject



658
659
660
661
662
# File 'lib/kube/ctl/string_builder.rb', line 658

def test_kubectl_create_secret_tls_tls_secret_cert_path_to_tls_cert_key_path_to_tls_key
  result = Kube.ctl { create.secret.tls.tls-secret.cert('path/to/tls.cert').key('path/to/tls.key') }
  assert_buffer(result, [["create", []], ["secret", []], ["tls", []], ["tls", []], :dash, ["secret", []], ["cert", ["path/to/tls.cert"]], ["key", ["path/to/tls.key"]]])
  assert_string(result, "create secret tls tls-secret --cert=path/to/tls.cert --key=path/to/tls.key")
end

#test_kubectl_create_service_clusterip_my_cs_clusterip_noneObject



670
671
672
673
674
# File 'lib/kube/ctl/string_builder.rb', line 670

def test_kubectl_create_service_clusterip_my_cs_clusterip_none
  result = Kube.ctl { create.service.clusterip.my-cs.clusterip('"None"') }
  assert_buffer(result, [["create", []], ["service", []], ["clusterip", []], ["my", []], :dash, ["cs", []], ["clusterip", ["\"None\""]]])
  assert_string(result, "create service clusterip my-cs --clusterip=\"None\"")
end

#test_kubectl_create_service_clusterip_my_cs_tcp_5678_8080Object



664
665
666
667
668
# File 'lib/kube/ctl/string_builder.rb', line 664

def test_kubectl_create_service_clusterip_my_cs_tcp_5678_8080
  result = Kube.ctl { create.service.clusterip.my-cs.tcp('5678:8080') }
  assert_buffer(result, [["create", []], ["service", []], ["clusterip", []], ["my", []], :dash, ["cs", []], ["tcp", ["5678:8080"]]])
  assert_string(result, "create service clusterip my-cs --tcp=5678:8080")
end

#test_kubectl_create_service_externalname_my_ns_external_name_bar_comObject



676
677
678
679
680
# File 'lib/kube/ctl/string_builder.rb', line 676

def test_kubectl_create_service_externalname_my_ns_external_name_bar_com
  result = Kube.ctl { create.service.externalname.my-ns.external_name('bar.com') }
  assert_buffer(result, [["create", []], ["service", []], ["externalname", []], ["my", []], :dash, ["ns", []], ["external_name", ["bar.com"]]])
  assert_string(result, "create service externalname my-ns --external-name=bar.com")
end

#test_kubectl_create_service_loadbalancer_my_lbs_tcp_5678_8080Object



682
683
684
685
686
# File 'lib/kube/ctl/string_builder.rb', line 682

def test_kubectl_create_service_loadbalancer_my_lbs_tcp_5678_8080
  result = Kube.ctl { create.service.loadbalancer.my-lbs.tcp('5678:8080') }
  assert_buffer(result, [["create", []], ["service", []], ["loadbalancer", []], ["my", []], :dash, ["lbs", []], ["tcp", ["5678:8080"]]])
  assert_string(result, "create service loadbalancer my-lbs --tcp=5678:8080")
end

#test_kubectl_create_service_nodeport_my_ns_tcp_5678_8080Object



688
689
690
691
692
# File 'lib/kube/ctl/string_builder.rb', line 688

def test_kubectl_create_service_nodeport_my_ns_tcp_5678_8080
  result = Kube.ctl { create.service.nodeport.my-ns.tcp('5678:8080') }
  assert_buffer(result, [["create", []], ["service", []], ["nodeport", []], ["my", []], :dash, ["ns", []], ["tcp", ["5678:8080"]]])
  assert_string(result, "create service nodeport my-ns --tcp=5678:8080")
end

#test_kubectl_create_serviceaccount_my_service_accountObject



694
695
696
697
698
# File 'lib/kube/ctl/string_builder.rb', line 694

def 
  result = Kube.ctl { create.serviceaccount.my-service- }
  assert_buffer(result, [["create", []], ["serviceaccount", []], ["my", []], :dash, ["service", []], :dash, ["account", []]])
  assert_string(result, "create serviceaccount my-service-account")
end

#test_kubectl_delete_f_pod_jsonObject



700
701
702
703
704
# File 'lib/kube/ctl/string_builder.rb', line 700

def test_kubectl_delete_f_pod_json
  result = Kube.ctl { delete.f './pod.json' }
  assert_buffer(result, [["delete", []], ["f", ["./pod.json"]]])
  assert_string(result, "delete -f ./pod.json")
end

#test_kubectl_delete_pod_foo_grace_period_0_forceObject



724
725
726
727
728
# File 'lib/kube/ctl/string_builder.rb', line 724

def test_kubectl_delete_pod_foo_grace_period_0_force
  result = Kube.ctl { delete.pod.foo.grace_period(0).force(true) }
  assert_buffer(result, [["delete", []], ["pod", []], ["foo", []], ["grace_period", [0]], ["force", [true]]])
  assert_string(result, "delete pod foo --grace-period=0 --force")
end

#test_kubectl_delete_pod_foo_nowObject



718
719
720
721
722
# File 'lib/kube/ctl/string_builder.rb', line 718

def test_kubectl_delete_pod_foo_now
  result = Kube.ctl { delete.pod.foo.now(true) }
  assert_buffer(result, [["delete", []], ["pod", []], ["foo", []], ["now", [true]]])
  assert_string(result, "delete pod foo --now")
end

#test_kubectl_delete_pod_service_baz_fooObject



706
707
708
709
710
# File 'lib/kube/ctl/string_builder.rb', line 706

def test_kubectl_delete_pod_service_baz_foo
  result = Kube.ctl { delete.('pod,service').baz.foo }
  assert_buffer(result, [["delete", []], ["pod,service", []], ["baz", []], ["foo", []]])
  assert_string(result, "delete pod,service baz foo")
end

#test_kubectl_delete_pods_allObject



730
731
732
733
734
# File 'lib/kube/ctl/string_builder.rb', line 730

def test_kubectl_delete_pods_all
  result = Kube.ctl { delete.pods.all(true) }
  assert_buffer(result, [["delete", []], ["pods", []], ["all", [true]]])
  assert_string(result, "delete pods --all")
end

#test_kubectl_delete_pods_services_l_name_mylabelObject



712
713
714
715
716
# File 'lib/kube/ctl/string_builder.rb', line 712

def test_kubectl_delete_pods_services_l_name_mylabel
  result = Kube.ctl { delete.('pods,services').l(name: 'myLabel') }
  assert_buffer(result, [["delete", []], ["pods,services", []], ["l", [{name: "myLabel"}]]])
  assert_string(result, "delete pods,services -l name=myLabel")
end

#test_kubectl_describe_f_pod_jsonObject



748
749
750
751
752
# File 'lib/kube/ctl/string_builder.rb', line 748

def test_kubectl_describe_f_pod_json
  result = Kube.ctl { describe.f 'pod.json' }
  assert_buffer(result, [["describe", []], ["f", ["pod.json"]]])
  assert_string(result, "describe -f pod.json")
end

#test_kubectl_describe_nodes_kubernetes_node_emt8_c_myproject_internalObject



736
737
738
739
740
# File 'lib/kube/ctl/string_builder.rb', line 736

def test_kubectl_describe_nodes_kubernetes_node_emt8_c_myproject_internal
  result = Kube.ctl { describe.nodes.('kubernetes-node-emt8.c.myproject.internal') }
  assert_buffer(result, [["describe", []], ["nodes", []], ["kubernetes-node-emt8.c.myproject.internal", []]])
  assert_string(result, "describe nodes kubernetes-node-emt8.c.myproject.internal")
end

#test_kubectl_describe_po_l_name_mylabelObject



760
761
762
763
764
# File 'lib/kube/ctl/string_builder.rb', line 760

def test_kubectl_describe_po_l_name_mylabel
  result = Kube.ctl { describe.po.l(name: 'myLabel') }
  assert_buffer(result, [["describe", []], ["po", []], ["l", [{name: "myLabel"}]]])
  assert_string(result, "describe po -l name=myLabel")
end

#test_kubectl_describe_podsObject



754
755
756
757
758
# File 'lib/kube/ctl/string_builder.rb', line 754

def test_kubectl_describe_pods
  result = Kube.ctl { describe.pods }
  assert_buffer(result, [["describe", []], ["pods", []]])
  assert_string(result, "describe pods")
end

#test_kubectl_describe_pods_frontendObject



766
767
768
769
770
# File 'lib/kube/ctl/string_builder.rb', line 766

def test_kubectl_describe_pods_frontend
  result = Kube.ctl { describe.pods.frontend }
  assert_buffer(result, [["describe", []], ["pods", []], ["frontend", []]])
  assert_string(result, "describe pods frontend")
end

#test_kubectl_describe_pods_nginxObject



742
743
744
745
746
# File 'lib/kube/ctl/string_builder.rb', line 742

def test_kubectl_describe_pods_nginx
  result = Kube.ctl { describe.pods/nginx }
  assert_buffer(result, [["describe", []], ["pods", []], :slash, ["nginx", []]])
  assert_string(result, "describe pods/nginx")
end

#test_kubectl_drain_foo_forceObject



772
773
774
775
776
# File 'lib/kube/ctl/string_builder.rb', line 772

def test_kubectl_drain_foo_force
  result = Kube.ctl { drain.foo.force(true) }
  assert_buffer(result, [["drain", []], ["foo", []], ["force", [true]]])
  assert_string(result, "drain foo --force")
end

#test_kubectl_drain_foo_grace_period_900Object



778
779
780
781
782
# File 'lib/kube/ctl/string_builder.rb', line 778

def test_kubectl_drain_foo_grace_period_900
  result = Kube.ctl { drain.foo.grace_period(900) }
  assert_buffer(result, [["drain", []], ["foo", []], ["grace_period", [900]]])
  assert_string(result, "drain foo --grace-period=900")
end

#test_kubectl_edit_deployment_mydeployment_o_yaml_save_configObject



796
797
798
799
800
# File 'lib/kube/ctl/string_builder.rb', line 796

def test_kubectl_edit_deployment_mydeployment_o_yaml_save_config
  result = Kube.ctl { edit.deployment/mydeployment.o(:yaml).save_config(true) }
  assert_buffer(result, [["edit", []], ["deployment", []], :slash, ["mydeployment", []], ["o", [:yaml]], ["save_config", [true]]])
  assert_string(result, "edit deployment/mydeployment -o yaml --save-config")
end

#test_kubectl_edit_job_v1_batch_myjob_o_jsonObject



790
791
792
793
794
# File 'lib/kube/ctl/string_builder.rb', line 790

def test_kubectl_edit_job_v1_batch_myjob_o_json
  result = Kube.ctl { edit.job.v1.batch/myjob.o('json') }
  assert_buffer(result, [["edit", []], ["job", []], ["v1", []], ["batch", []], :slash, ["myjob", []], ["o", ["json"]]])
  assert_string(result, "edit job v1 batch/myjob -o json")
end

#test_kubectl_edit_svc_docker_registryObject



784
785
786
787
788
# File 'lib/kube/ctl/string_builder.rb', line 784

def test_kubectl_edit_svc_docker_registry
  result = Kube.ctl { edit.svc/docker-registry }
  assert_buffer(result, [["edit", []], ["svc", []], :slash, ["docker", []], :dash, ["registry", []]])
  assert_string(result, "edit svc/docker-registry")
end

#test_kubectl_explain_podsObject

Skipped: numeric literal 123456-7890 is not valid Ruby syntax def test_kubectl_exec_123456_7890_date def test_kubectl_exec_123456_7890_c_ruby_container_date def test_kubectl_exec_123456_7890_c_ruby_container_i_t_bash_il def test_kubectl_exec_123456_7890_i_t_ls_t_usr



808
809
810
811
812
# File 'lib/kube/ctl/string_builder.rb', line 808

def test_kubectl_explain_pods
  result = Kube.ctl { explain.pods }
  assert_buffer(result, [["explain", []], ["pods", []]])
  assert_string(result, "explain pods")
end

#test_kubectl_explain_pods_spec_containersObject



814
815
816
817
818
# File 'lib/kube/ctl/string_builder.rb', line 814

def test_kubectl_explain_pods_spec_containers
  result = Kube.ctl { explain.pods.spec.containers }
  assert_buffer(result, [["explain", []], ["pods", []], ["spec", []], ["containers", []]])
  assert_string(result, "explain pods spec containers")
end

#test_kubectl_expose_deployment_nginx_port_80_target_port_8000Object



856
857
858
859
860
# File 'lib/kube/ctl/string_builder.rb', line 856

def test_kubectl_expose_deployment_nginx_port_80_target_port_8000
  result = Kube.ctl { expose.deployment.nginx.port(80).target_port(8000) }
  assert_buffer(result, [["expose", []], ["deployment", []], ["nginx", []], ["port", [80]], ["target_port", [8000]]])
  assert_string(result, "expose deployment nginx --port=80 --target-port=8000")
end

#test_kubectl_expose_f_nginx_controller_yaml_port_80_target_port_8000Object



826
827
828
829
830
# File 'lib/kube/ctl/string_builder.rb', line 826

def test_kubectl_expose_f_nginx_controller_yaml_port_80_target_port_8000
  result = Kube.ctl { expose.f('nginx-controller.yaml').port(80).target_port(8000) }
  assert_buffer(result, [["expose", []], ["f", ["nginx-controller.yaml"]], ["port", [80]], ["target_port", [8000]]])
  assert_string(result, "expose -f nginx-controller.yaml --port=80 --target-port=8000")
end

#test_kubectl_expose_pod_valid_pod_port_444_name_frontendObject



832
833
834
835
836
# File 'lib/kube/ctl/string_builder.rb', line 832

def test_kubectl_expose_pod_valid_pod_port_444_name_frontend
  result = Kube.ctl { expose.pod.valid-pod.port(444).name(:frontend) }
  assert_buffer(result, [["expose", []], ["pod", []], ["valid", []], :dash, ["pod", []], ["port", [444]], ["name", [:frontend]]])
  assert_string(result, "expose pod valid-pod --port=444 --name=frontend")
end

#test_kubectl_expose_rc_nginx_port_80_target_port_8000Object



820
821
822
823
824
# File 'lib/kube/ctl/string_builder.rb', line 820

def test_kubectl_expose_rc_nginx_port_80_target_port_8000
  result = Kube.ctl { expose.rc.nginx.port(80).target_port(8000) }
  assert_buffer(result, [["expose", []], ["rc", []], ["nginx", []], ["port", [80]], ["target_port", [8000]]])
  assert_string(result, "expose rc nginx --port=80 --target-port=8000")
end

#test_kubectl_expose_rc_streamer_port_4100_protocol_udp_name_video_streamObject



844
845
846
847
848
# File 'lib/kube/ctl/string_builder.rb', line 844

def test_kubectl_expose_rc_streamer_port_4100_protocol_udp_name_video_stream
  result = Kube.ctl { expose.rc.streamer.port(4100).protocol(:udp).name('video-stream') }
  assert_buffer(result, [["expose", []], ["rc", []], ["streamer", []], ["port", [4100]], ["protocol", [:udp]], ["name", ["video-stream"]]])
  assert_string(result, "expose rc streamer --port=4100 --protocol=udp --name=video-stream")
end

#test_kubectl_expose_rs_nginx_port_80_target_port_8000Object



850
851
852
853
854
# File 'lib/kube/ctl/string_builder.rb', line 850

def test_kubectl_expose_rs_nginx_port_80_target_port_8000
  result = Kube.ctl { expose.rs.nginx.port(80).target_port(8000) }
  assert_buffer(result, [["expose", []], ["rs", []], ["nginx", []], ["port", [80]], ["target_port", [8000]]])
  assert_string(result, "expose rs nginx --port=80 --target-port=8000")
end

#test_kubectl_expose_service_nginx_port_443_target_port_8443_name_nginx_httpsObject



838
839
840
841
842
# File 'lib/kube/ctl/string_builder.rb', line 838

def test_kubectl_expose_service_nginx_port_443_target_port_8443_name_nginx_https
  result = Kube.ctl { expose.service.nginx.port(443).target_port(8443).name('nginx-https') }
  assert_buffer(result, [["expose", []], ["service", []], ["nginx", []], ["port", [443]], ["target_port", [8443]], ["name", ["nginx-https"]]])
  assert_string(result, "expose service nginx --port=443 --target-port=8443 --name=nginx-https")
end

#test_kubectl_get_allObject



892
893
894
895
896
# File 'lib/kube/ctl/string_builder.rb', line 892

def test_kubectl_get_all
  result = Kube.ctl { get.all }
  assert_buffer(result, [["get", []], ["all", []]])
  assert_string(result, "get all")
end

#test_kubectl_get_f_pod_yaml_o_jsonObject



880
881
882
883
884
# File 'lib/kube/ctl/string_builder.rb', line 880

def test_kubectl_get_f_pod_yaml_o_json
  result = Kube.ctl { get.f('pod.yaml').o(:json) }
  assert_buffer(result, [["get", []], ["f", ["pod.yaml"]], ["o", [:json]]])
  assert_string(result, "get -f pod.yaml -o json")
end

#test_kubectl_get_pod_mypod_o_yamlObject



1390
1391
1392
1393
1394
# File 'lib/kube/ctl/string_builder.rb', line 1390

def test_kubectl_get_pod_mypod_o_yaml
  result = Kube.ctl { get.pod.mypod.o :yaml }
  assert_buffer(result, [["get", []], ["pod", []], ["mypod", []], ["o", [:yaml]]])
  assert_string(result, "get pod mypod -o yaml")
end

#test_kubectl_get_podsObject



862
863
864
865
866
# File 'lib/kube/ctl/string_builder.rb', line 862

def test_kubectl_get_pods
  result = Kube.ctl { get.pods }
  assert_buffer(result, [["get", []], ["pods", []]])
  assert_string(result, "get pods")
end

#test_kubectl_get_pods_o_wideObject



868
869
870
871
872
# File 'lib/kube/ctl/string_builder.rb', line 868

def test_kubectl_get_pods_o_wide
  result = Kube.ctl { get.pods.o(:wide) }
  assert_buffer(result, [["get", []], ["pods", []], ["o", [:wide]]])
  assert_string(result, "get pods -o wide")
end

#test_kubectl_get_rc_servicesObject



886
887
888
889
890
# File 'lib/kube/ctl/string_builder.rb', line 886

def test_kubectl_get_rc_services
  result = Kube.ctl { get.('rc,services') }
  assert_buffer(result, [["get", []], ["rc,services", []]])
  assert_string(result, "get rc,services")
end

#test_kubectl_get_replicationcontroller_webObject



874
875
876
877
878
# File 'lib/kube/ctl/string_builder.rb', line 874

def test_kubectl_get_replicationcontroller_web
  result = Kube.ctl { get.replicationcontroller.web }
  assert_buffer(result, [["get", []], ["replicationcontroller", []], ["web", []]])
  assert_string(result, "get replicationcontroller web")
end

#test_kubectl_label_f_pod_json_status_unhealthyObject



916
917
918
919
920
# File 'lib/kube/ctl/string_builder.rb', line 916

def test_kubectl_label_f_pod_json_status_unhealthy
  result = Kube.ctl { label.f('pod.json').(status: 'unhealthy') }
  assert_buffer(result, [["label", []], ["f", ["pod.json"]], [{status: "unhealthy"}]])
  assert_string(result, "label -f pod.json status=unhealthy")
end

#test_kubectl_label_overwrite_pods_foo_status_unhealthyObject



904
905
906
907
908
# File 'lib/kube/ctl/string_builder.rb', line 904

def test_kubectl_label_overwrite_pods_foo_status_unhealthy
  result = Kube.ctl { label.overwrite(true).pods.foo.(status: 'unhealthy') }
  assert_buffer(result, [["label", []], ["overwrite", [true]], ["pods", []], ["foo", []], [{status: "unhealthy"}]])
  assert_string(result, "label --overwrite pods foo status=unhealthy")
end

#test_kubectl_label_pods_all_status_unhealthyObject



910
911
912
913
914
# File 'lib/kube/ctl/string_builder.rb', line 910

def test_kubectl_label_pods_all_status_unhealthy
  result = Kube.ctl { label.pods.all(true).(status: 'unhealthy') }
  assert_buffer(result, [["label", []], ["pods", []], ["all", [true]], [{status: "unhealthy"}]])
  assert_string(result, "label pods --all status=unhealthy")
end

#test_kubectl_label_pods_foo_status_unhealthy_resource_version_1Object



922
923
924
925
926
# File 'lib/kube/ctl/string_builder.rb', line 922

def test_kubectl_label_pods_foo_status_unhealthy_resource_version_1
  result = Kube.ctl { label.pods.foo.(status: 'unhealthy').resource_version(1) }
  assert_buffer(result, [["label", []], ["pods", []], ["foo", []], [{status: "unhealthy"}], ["resource_version", [1]]])
  assert_string(result, "label pods foo status=unhealthy --resource-version=1")
end

#test_kubectl_label_pods_foo_unhealthy_trueObject



898
899
900
901
902
# File 'lib/kube/ctl/string_builder.rb', line 898

def test_kubectl_label_pods_foo_unhealthy_true
  result = Kube.ctl { label.pods.foo.(unhealthy: 'true') }
  assert_buffer(result, [["label", []], ["pods", []], ["foo", []], [{unhealthy: "true"}]])
  assert_string(result, "label pods foo unhealthy=true")
end

#test_kubectl_logs_deployment_nginx_c_nginx_1Object



970
971
972
973
974
# File 'lib/kube/ctl/string_builder.rb', line 970

def test_kubectl_logs_deployment_nginx_c_nginx_1
  result = Kube.ctl { logs.deployment/nginx.c('nginx-1') }
  assert_buffer(result, [["logs", []], ["deployment", []], :slash, ["nginx", []], ["c", ["nginx-1"]]])
  assert_string(result, "logs deployment/nginx -c nginx-1")
end

#test_kubectl_logs_f_c_ruby_web_1Object



946
947
948
949
950
# File 'lib/kube/ctl/string_builder.rb', line 946

def test_kubectl_logs_f_c_ruby_web_1
  result = Kube.ctl { logs.f(true).c(:ruby).web-1 }
  assert_buffer(result, [["logs", []], ["f", [true]], ["c", [:ruby]], ["web", []], :dash, ["1", []]])
  assert_string(result, "logs -f -c ruby web-1")
end

#test_kubectl_logs_job_helloObject



964
965
966
967
968
# File 'lib/kube/ctl/string_builder.rb', line 964

def test_kubectl_logs_job_hello
  result = Kube.ctl { logs.job/hello }
  assert_buffer(result, [["logs", []], ["job", []], :slash, ["hello", []]])
  assert_string(result, "logs job/hello")
end

#test_kubectl_logs_l_app_nginxObject



934
935
936
937
938
# File 'lib/kube/ctl/string_builder.rb', line 934

def test_kubectl_logs_l_app_nginx
  result = Kube.ctl { logs.l(app: :nginx) }
  assert_buffer(result, [["logs", []], ["l", [{app: :nginx}]]])
  assert_string(result, "logs -l app=nginx")
end

#test_kubectl_logs_nginxObject



928
929
930
931
932
# File 'lib/kube/ctl/string_builder.rb', line 928

def test_kubectl_logs_nginx
  result = Kube.ctl { logs.nginx }
  assert_buffer(result, [["logs", []], ["nginx", []]])
  assert_string(result, "logs nginx")
end

#test_kubectl_logs_p_c_ruby_web_1Object



940
941
942
943
944
# File 'lib/kube/ctl/string_builder.rb', line 940

def test_kubectl_logs_p_c_ruby_web_1
  result = Kube.ctl { logs.p(true).c(:ruby).web-1 }
  assert_buffer(result, [["logs", []], ["p", [true]], ["c", [:ruby]], ["web", []], :dash, ["1", []]])
  assert_string(result, "logs -p -c ruby web-1")
end

#test_kubectl_logs_since_1h_nginxObject



958
959
960
961
962
# File 'lib/kube/ctl/string_builder.rb', line 958

def test_kubectl_logs_since_1h_nginx
  result = Kube.ctl { logs.since('1h').nginx }
  assert_buffer(result, [["logs", []], ["since", ["1h"]], ["nginx", []]])
  assert_string(result, "logs --since=1h nginx")
end

#test_kubectl_logs_tail_20_nginxObject



952
953
954
955
956
# File 'lib/kube/ctl/string_builder.rb', line 952

def test_kubectl_logs_tail_20_nginx
  result = Kube.ctl { logs.tail(20).nginx }
  assert_buffer(result, [["logs", []], ["tail", [20]], ["nginx", []]])
  assert_string(result, "logs --tail=20 nginx")
end

#test_kubectl_optionsObject



976
977
978
979
980
# File 'lib/kube/ctl/string_builder.rb', line 976

def test_kubectl_options
  result = Kube.ctl { options }
  assert_buffer(result, [["options", []]])
  assert_string(result, "options")
end

#test_kubectl_patch_f_node_json_p_spec_unschedulable_trueObject



988
989
990
991
992
# File 'lib/kube/ctl/string_builder.rb', line 988

def test_kubectl_patch_f_node_json_p_spec_unschedulable_true
  result = Kube.ctl { patch.f('node.json').p('\'{"spec":{"unschedulable":true}}\'') }
  assert_buffer(result, [["patch", []], ["f", ["node.json"]], ["p", ["'{\"spec\":{\"unschedulable\":true}}'"]]])
  assert_string(result, "patch -f node.json -p '{\"spec\":{\"unschedulable\":true}}'")
end

#test_kubectl_patch_node_k8s_node_1_p_spec_unschedulable_trueObject



982
983
984
985
986
# File 'lib/kube/ctl/string_builder.rb', line 982

def test_kubectl_patch_node_k8s_node_1_p_spec_unschedulable_true
  result = Kube.ctl { patch.node.k8s-node-1.p('\'{"spec":{"unschedulable":true}}\'') }
  assert_buffer(result, [["patch", []], ["node", []], ["k8s", []], :dash, ["node", []], :dash, ["1", []], ["p", ["'{\"spec\":{\"unschedulable\":true}}'"]]])
  assert_string(result, "patch node k8s-node-1 -p '{\"spec\":{\"unschedulable\":true}}'")
end

#test_kubectl_patch_pod_valid_pod_p_spec_containers_name_kubernetes_serve_hostname_image_new_imageObject



994
995
996
997
998
# File 'lib/kube/ctl/string_builder.rb', line 994

def test_kubectl_patch_pod_valid_pod_p_spec_containers_name_kubernetes_serve_hostname_image_new_image
  result = Kube.ctl { patch.pod.valid-pod.p('\'{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}\'') }
  assert_buffer(result, [["patch", []], ["pod", []], ["valid", []], :dash, ["pod", []], ["p", ["'{\"spec\":{\"containers\":[{\"name\":\"kubernetes-serve-hostname\",\"image\":\"new image\"}]}}'"]]])
  assert_string(result, "patch pod valid-pod -p '{\"spec\":{\"containers\":[{\"name\":\"kubernetes-serve-hostname\",\"image\":\"new image\"}]}}'")
end

#test_kubectl_patch_pod_valid_pod_type_json_p_op_replace_path_spec_containers_0_image_value_new_imageObject



1000
1001
1002
1003
1004
# File 'lib/kube/ctl/string_builder.rb', line 1000

def test_kubectl_patch_pod_valid_pod_type_json_p_op_replace_path_spec_containers_0_image_value_new_image
  result = Kube.ctl { patch.pod.valid-pod.type("'json'").p("'[{\"op\": \"replace\", \"path\": \"/spec/containers/0/image\", \"value\":\"new image\"}]'") }
  assert_buffer(result, [["patch", []], ["pod", []], ["valid", []], :dash, ["pod", []], ["type", ["'json'"]], ["p", ["'[{\"op\": \"replace\", \"path\": \"/spec/containers/0/image\", \"value\":\"new image\"}]'"]]])
  assert_string(result, "patch pod valid-pod --type='json' -p '[{\"op\": \"replace\", \"path\": \"/spec/containers/0/image\", \"value\":\"new image\"}]'")
end

#test_kubectl_port_forward_mypod_0_5000Object



1024
1025
1026
1027
1028
# File 'lib/kube/ctl/string_builder.rb', line 1024

def test_kubectl_port_forward_mypod_0_5000
  result = Kube.ctl { port-forward.mypod.('0:5000') }
  assert_buffer(result, [["port", []], :dash, ["forward", []], ["mypod", []], ["0:5000", []]])
  assert_string(result, "port-forward mypod 0:5000")
end

#test_kubectl_port_forward_mypod_5000Object



1018
1019
1020
1021
1022
# File 'lib/kube/ctl/string_builder.rb', line 1018

def test_kubectl_port_forward_mypod_5000
  result = Kube.ctl { port-forward.mypod.(':5000') }
  assert_buffer(result, [["port", []], :dash, ["forward", []], ["mypod", []], [":5000", []]])
  assert_string(result, "port-forward mypod :5000")
end

#test_kubectl_port_forward_mypod_5000_6000Object



1006
1007
1008
1009
1010
# File 'lib/kube/ctl/string_builder.rb', line 1006

def test_kubectl_port_forward_mypod_5000_6000
  result = Kube.ctl { port-forward.mypod.('5000').('6000') }
  assert_buffer(result, [["port", []], :dash, ["forward", []], ["mypod", []], ["5000", []], ["6000", []]])
  assert_string(result, "port-forward mypod 5000 6000")
end

#test_kubectl_port_forward_mypod_8888_5000Object



1012
1013
1014
1015
1016
# File 'lib/kube/ctl/string_builder.rb', line 1012

def test_kubectl_port_forward_mypod_8888_5000
  result = Kube.ctl { port-forward.mypod.('8888:5000') }
  assert_buffer(result, [["port", []], :dash, ["forward", []], ["mypod", []], ["8888:5000", []]])
  assert_string(result, "port-forward mypod 8888:5000")
end

#test_kubectl_proxy_api_prefixObject



1030
1031
1032
1033
1034
# File 'lib/kube/ctl/string_builder.rb', line 1030

def test_kubectl_proxy_api_prefix
  result = Kube.ctl { proxy.api_prefix('/') }
  assert_buffer(result, [["proxy", []], ["api_prefix", ["/"]]])
  assert_string(result, "proxy --api-prefix=/")
end

#test_kubectl_proxy_api_prefix_customObject



1042
1043
1044
1045
1046
# File 'lib/kube/ctl/string_builder.rb', line 1042

def test_kubectl_proxy_api_prefix_custom
  result = Kube.ctl { proxy.api_prefix('/custom/') }
  assert_buffer(result, [["proxy", []], ["api_prefix", ["/custom/"]]])
  assert_string(result, "proxy --api-prefix=/custom/")
end

#test_kubectl_proxy_api_prefix_k8s_apiObject



1060
1061
1062
1063
1064
# File 'lib/kube/ctl/string_builder.rb', line 1060

def test_kubectl_proxy_api_prefix_k8s_api
  result = Kube.ctl { proxy.api_prefix('/k8s-api') }
  assert_buffer(result, [["proxy", []], ["api_prefix", ["/k8s-api"]]])
  assert_string(result, "proxy --api-prefix=/k8s-api")
end

#test_kubectl_proxy_port_0Object



1054
1055
1056
1057
1058
# File 'lib/kube/ctl/string_builder.rb', line 1054

def test_kubectl_proxy_port_0
  result = Kube.ctl { proxy.port(0) }
  assert_buffer(result, [["proxy", []], ["port", [0]]])
  assert_string(result, "proxy --port=0")
end

#test_kubectl_proxy_port_8011_www_local_wwwObject



1048
1049
1050
1051
1052
# File 'lib/kube/ctl/string_builder.rb', line 1048

def test_kubectl_proxy_port_8011_www_local_www
  result = Kube.ctl { proxy.port(8011).www('./local/www/') }
  assert_buffer(result, [["proxy", []], ["port", [8011]], ["www", ["./local/www/"]]])
  assert_string(result, "proxy --port=8011 --www=./local/www/")
end

#test_kubectl_proxy_www_my_files_www_prefix_static_api_prefix_apiObject



1036
1037
1038
1039
1040
# File 'lib/kube/ctl/string_builder.rb', line 1036

def test_kubectl_proxy_www_my_files_www_prefix_static_api_prefix_api
  result = Kube.ctl { proxy.www('/my/files').www_prefix('/static/').api_prefix('/api/') }
  assert_buffer(result, [["proxy", []], ["www", ["/my/files"]], ["www_prefix", ["/static/"]], ["api_prefix", ["/api/"]]])
  assert_string(result, "proxy --www=/my/files --www-prefix=/static/ --api-prefix=/api/")
end

#test_kubectl_replace_f_pod_jsonObject



1066
1067
1068
1069
1070
# File 'lib/kube/ctl/string_builder.rb', line 1066

def test_kubectl_replace_f_pod_json
  result = Kube.ctl { replace.f './pod.json' }
  assert_buffer(result, [["replace", []], ["f", ["./pod.json"]]])
  assert_string(result, "replace -f ./pod.json")
end

#test_kubectl_replace_force_f_pod_jsonObject



1072
1073
1074
1075
1076
# File 'lib/kube/ctl/string_builder.rb', line 1072

def test_kubectl_replace_force_f_pod_json
  result = Kube.ctl { replace.force(true).f './pod.json' }
  assert_buffer(result, [["replace", []], ["force", [true]], ["f", ["./pod.json"]]])
  assert_string(result, "replace --force -f ./pod.json")
end

#test_kubectl_rolling_update_frontend_image_image_v2Object



1120
1121
1122
1123
1124
# File 'lib/kube/ctl/string_builder.rb', line 1120

def test_kubectl_rolling_update_frontend_image_image_v2
  result = Kube.ctl { rolling-update.frontend.image('image:v2') }
  assert_buffer(result, [["rolling", []], :dash, ["update", []], ["frontend", []], ["image", ["image:v2"]]])
  assert_string(result, "rolling-update frontend --image=image:v2")
end

#test_kubectl_rolling_update_frontend_v1_f_frontend_v2_jsonObject



1108
1109
1110
1111
1112
# File 'lib/kube/ctl/string_builder.rb', line 1108

def test_kubectl_rolling_update_frontend_v1_f_frontend_v2_json
  result = Kube.ctl { rolling-update.frontend-v1.f('frontend-v2.json') }
  assert_buffer(result, [["rolling", []], :dash, ["update", []], ["frontend", []], :dash, ["v1", []], ["f", ["frontend-v2.json"]]])
  assert_string(result, "rolling-update frontend-v1 -f frontend-v2.json")
end

#test_kubectl_rolling_update_frontend_v1_frontend_v2_image_image_v2Object



1114
1115
1116
1117
1118
# File 'lib/kube/ctl/string_builder.rb', line 1114

def test_kubectl_rolling_update_frontend_v1_frontend_v2_image_image_v2
  result = Kube.ctl { rolling-update.frontend-v1.frontend-v2.image('image:v2') }
  assert_buffer(result, [["rolling", []], :dash, ["update", []], ["frontend", []], :dash, ["v1", []], ["frontend", []], :dash, ["v2", []], ["image", ["image:v2"]]])
  assert_string(result, "rolling-update frontend-v1 frontend-v2 --image=image:v2")
end

#test_kubectl_rolling_update_frontend_v1_frontend_v2_rollbackObject



1126
1127
1128
1129
1130
# File 'lib/kube/ctl/string_builder.rb', line 1126

def test_kubectl_rolling_update_frontend_v1_frontend_v2_rollback
  result = Kube.ctl { rolling-update.frontend-v1.frontend-v2.rollback(true) }
  assert_buffer(result, [["rolling", []], :dash, ["update", []], ["frontend", []], :dash, ["v1", []], ["frontend", []], :dash, ["v2", []], ["rollback", [true]]])
  assert_string(result, "rolling-update frontend-v1 frontend-v2 --rollback")
end

#test_kubectl_rollout_history_daemonset_abc_revision_3Object



1150
1151
1152
1153
1154
# File 'lib/kube/ctl/string_builder.rb', line 1150

def test_kubectl_rollout_history_daemonset_abc_revision_3
  result = Kube.ctl { rollout.history.daemonset/abc.revision(3) }
  assert_buffer(result, [["rollout", []], ["history", []], ["daemonset", []], :slash, ["abc", []], ["revision", [3]]])
  assert_string(result, "rollout history daemonset/abc --revision=3")
end

#test_kubectl_rollout_history_deployment_abcObject



1144
1145
1146
1147
1148
# File 'lib/kube/ctl/string_builder.rb', line 1144

def test_kubectl_rollout_history_deployment_abc
  result = Kube.ctl { rollout.history.deployment/abc }
  assert_buffer(result, [["rollout", []], ["history", []], ["deployment", []], :slash, ["abc", []]])
  assert_string(result, "rollout history deployment/abc")
end

#test_kubectl_rollout_pause_deployment_nginxObject



1156
1157
1158
1159
1160
# File 'lib/kube/ctl/string_builder.rb', line 1156

def test_kubectl_rollout_pause_deployment_nginx
  result = Kube.ctl { rollout.pause.deployment/nginx }
  assert_buffer(result, [["rollout", []], ["pause", []], ["deployment", []], :slash, ["nginx", []]])
  assert_string(result, "rollout pause deployment/nginx")
end

#test_kubectl_rollout_resume_deployment_nginxObject



1162
1163
1164
1165
1166
# File 'lib/kube/ctl/string_builder.rb', line 1162

def test_kubectl_rollout_resume_deployment_nginx
  result = Kube.ctl { rollout.resume.deployment/nginx }
  assert_buffer(result, [["rollout", []], ["resume", []], ["deployment", []], :slash, ["nginx", []]])
  assert_string(result, "rollout resume deployment/nginx")
end

#test_kubectl_rollout_status_daemonset_fooObject



1138
1139
1140
1141
1142
# File 'lib/kube/ctl/string_builder.rb', line 1138

def test_kubectl_rollout_status_daemonset_foo
  result = Kube.ctl { rollout.status.daemonset/foo }
  assert_buffer(result, [["rollout", []], ["status", []], ["daemonset", []], :slash, ["foo", []]])
  assert_string(result, "rollout status daemonset/foo")
end

#test_kubectl_rollout_status_deployment_nginxObject



1168
1169
1170
1171
1172
# File 'lib/kube/ctl/string_builder.rb', line 1168

def test_kubectl_rollout_status_deployment_nginx
  result = Kube.ctl { rollout.status.deployment/nginx }
  assert_buffer(result, [["rollout", []], ["status", []], ["deployment", []], :slash, ["nginx", []]])
  assert_string(result, "rollout status deployment/nginx")
end

#test_kubectl_rollout_undo_daemonset_abc_to_revision_3Object



1174
1175
1176
1177
1178
# File 'lib/kube/ctl/string_builder.rb', line 1174

def test_kubectl_rollout_undo_daemonset_abc_to_revision_3
  result = Kube.ctl { rollout.undo.daemonset/abc.to_revision(3) }
  assert_buffer(result, [["rollout", []], ["undo", []], ["daemonset", []], :slash, ["abc", []], ["to_revision", [3]]])
  assert_string(result, "rollout undo daemonset/abc --to-revision=3")
end

#test_kubectl_rollout_undo_deployment_abcObject



1132
1133
1134
1135
1136
# File 'lib/kube/ctl/string_builder.rb', line 1132

def test_kubectl_rollout_undo_deployment_abc
  result = Kube.ctl { rollout.undo.deployment/abc }
  assert_buffer(result, [["rollout", []], ["undo", []], ["deployment", []], :slash, ["abc", []]])
  assert_string(result, "rollout undo deployment/abc")
end

#test_kubectl_rollout_undo_dry_run_true_deployment_abcObject



1180
1181
1182
1183
1184
# File 'lib/kube/ctl/string_builder.rb', line 1180

def test_kubectl_rollout_undo_dry_run_true_deployment_abc
  result = Kube.ctl { rollout.undo.dry_run(true).deployment/abc }
  assert_buffer(result, [["rollout", []], ["undo", []], ["dry_run", [true]], ["deployment", []], :slash, ["abc", []]])
  assert_string(result, "rollout undo --dry-run deployment/abc")
end

#test_kubectl_run_hazelcast_image_hazelcast_env_dns_domain_cluster_env_pod_namespace_defaultObject



1198
1199
1200
1201
1202
# File 'lib/kube/ctl/string_builder.rb', line 1198

def test_kubectl_run_hazelcast_image_hazelcast_env_dns_domain_cluster_env_pod_namespace_default
  result = Kube.ctl { run.hazelcast.image(:hazelcast).env('"DNS_DOMAIN=cluster"').env('"POD_NAMESPACE=default"') }
  assert_buffer(result, [["run", []], ["hazelcast", []], ["image", [:hazelcast]], ["env", ["\"DNS_DOMAIN=cluster\""]], ["env", ["\"POD_NAMESPACE=default\""]]])
  assert_string(result, "run hazelcast --image=hazelcast --env=\"DNS_DOMAIN=cluster\" --env=\"POD_NAMESPACE=default\"")
end

#test_kubectl_run_hazelcast_image_hazelcast_port_5701Object



1192
1193
1194
1195
1196
# File 'lib/kube/ctl/string_builder.rb', line 1192

def test_kubectl_run_hazelcast_image_hazelcast_port_5701
  result = Kube.ctl { run.hazelcast.image(:hazelcast).port(5701) }
  assert_buffer(result, [["run", []], ["hazelcast", []], ["image", [:hazelcast]], ["port", [5701]]])
  assert_string(result, "run hazelcast --image=hazelcast --port=5701")
end

#test_kubectl_run_i_t_busybox_image_busybox_restart_neverObject



1222
1223
1224
1225
1226
# File 'lib/kube/ctl/string_builder.rb', line 1222

def test_kubectl_run_i_t_busybox_image_busybox_restart_never
  result = Kube.ctl { run.i(true).t(true).busybox.image(:busybox).restart('Never') }
  assert_buffer(result, [["run", []], ["i", [true]], ["t", [true]], ["busybox", []], ["image", [:busybox]], ["restart", ["Never"]]])
  assert_string(result, "run -i -t busybox --image=busybox --restart=Never")
end

#test_kubectl_run_nginx_image_nginxObject



1186
1187
1188
1189
1190
# File 'lib/kube/ctl/string_builder.rb', line 1186

def test_kubectl_run_nginx_image_nginx
  result = Kube.ctl { run.nginx.image(:nginx) }
  assert_buffer(result, [["run", []], ["nginx", []], ["image", [:nginx]]])
  assert_string(result, "run nginx --image=nginx")
end

#test_kubectl_run_nginx_image_nginx_arg1_arg2_argnObject



1228
1229
1230
1231
1232
# File 'lib/kube/ctl/string_builder.rb', line 1228

def test_kubectl_run_nginx_image_nginx_arg1_arg2_argn
  result = Kube.ctl { run.nginx.image(:nginx).('-- <arg1> <arg2> ... <argN>') }
  assert_buffer(result, [["run", []], ["nginx", []], ["image", [:nginx]], ["-- <arg1> <arg2> ... <argN>", []]])
  assert_string(result, "run nginx --image=nginx -- <arg1> <arg2> ... <argN>")
end

#test_kubectl_run_nginx_image_nginx_command_cmd_arg1_argnObject



1234
1235
1236
1237
1238
# File 'lib/kube/ctl/string_builder.rb', line 1234

def test_kubectl_run_nginx_image_nginx_command_cmd_arg1_argn
  result = Kube.ctl { run.nginx.image(:nginx).command(true).('-- <cmd> <arg1> ... <argN>') }
  assert_buffer(result, [["run", []], ["nginx", []], ["image", [:nginx]], ["command", [true]], ["-- <cmd> <arg1> ... <argN>", []]])
  assert_string(result, "run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>")
end

#test_kubectl_run_nginx_image_nginx_dry_runObject



1210
1211
1212
1213
1214
# File 'lib/kube/ctl/string_builder.rb', line 1210

def test_kubectl_run_nginx_image_nginx_dry_run
  result = Kube.ctl { run.nginx.image(:nginx).dry_run(true) }
  assert_buffer(result, [["run", []], ["nginx", []], ["image", [:nginx]], ["dry_run", [true]]])
  assert_string(result, "run nginx --image=nginx --dry-run")
end

#test_kubectl_run_nginx_image_nginx_overrides_apiversion_v1_specObject



1216
1217
1218
1219
1220
# File 'lib/kube/ctl/string_builder.rb', line 1216

def test_kubectl_run_nginx_image_nginx_overrides_apiversion_v1_spec
  result = Kube.ctl { run.nginx.image(:nginx).overrides("'{ \"apiVersion\": \"v1\", \"spec\": { ... } }'") }
  assert_buffer(result, [["run", []], ["nginx", []], ["image", [:nginx]], ["overrides", ["'{ \"apiVersion\": \"v1\", \"spec\": { ... } }'"]]])
  assert_string(result, "run nginx --image=nginx --overrides='{ \"apiVersion\": \"v1\", \"spec\": { ... } }'")
end

#test_kubectl_run_nginx_image_nginx_replicas_5Object



1204
1205
1206
1207
1208
# File 'lib/kube/ctl/string_builder.rb', line 1204

def test_kubectl_run_nginx_image_nginx_replicas_5
  result = Kube.ctl { run.nginx.image(:nginx).replicas(5) }
  assert_buffer(result, [["run", []], ["nginx", []], ["image", [:nginx]], ["replicas", [5]]])
  assert_string(result, "run nginx --image=nginx --replicas=5")
end

#test_kubectl_run_pi_image_perl_restart_onfailure_perl_mbignum_bpi_wle_print_bpi_2000Object



1240
1241
1242
1243
1244
# File 'lib/kube/ctl/string_builder.rb', line 1240

def test_kubectl_run_pi_image_perl_restart_onfailure_perl_mbignum_bpi_wle_print_bpi_2000
  result = Kube.ctl { run.pi.image(:perl).restart('OnFailure').("-- perl -Mbignum=bpi -wle 'print bpi(2000)'") }
  assert_buffer(result, [["run", []], ["pi", []], ["image", [:perl]], ["restart", ["OnFailure"]], ["-- perl -Mbignum=bpi -wle 'print bpi(2000)'", []]])
  assert_string(result, "run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'")
end

#test_kubectl_run_pi_schedule_0_5_image_perl_restart_onfailure_perl_mbignum_bpi_wle_print_bpi_2000Object



1246
1247
1248
1249
1250
# File 'lib/kube/ctl/string_builder.rb', line 1246

def test_kubectl_run_pi_schedule_0_5_image_perl_restart_onfailure_perl_mbignum_bpi_wle_print_bpi_2000
  result = Kube.ctl { run.pi.schedule('"0/5 * * * ?"').image(:perl).restart('OnFailure').("-- perl -Mbignum=bpi -wle 'print bpi(2000)'") }
  assert_buffer(result, [["run", []], ["pi", []], ["schedule", ["\"0/5 * * * ?\""]], ["image", [:perl]], ["restart", ["OnFailure"]], ["-- perl -Mbignum=bpi -wle 'print bpi(2000)'", []]])
  assert_string(result, "run pi --schedule=\"0/5 * * * ?\" --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'")
end

#test_kubectl_scale_current_replicas_2_replicas_3_deployment_mysqlObject



1090
1091
1092
1093
1094
# File 'lib/kube/ctl/string_builder.rb', line 1090

def test_kubectl_scale_current_replicas_2_replicas_3_deployment_mysql
  result = Kube.ctl { scale.current_replicas(2).replicas(3).deployment/mysql }
  assert_buffer(result, [["scale", []], ["current_replicas", [2]], ["replicas", [3]], ["deployment", []], :slash, ["mysql", []]])
  assert_string(result, "scale --current-replicas=2 --replicas=3 deployment/mysql")
end

#test_kubectl_scale_replicas_3_f_foo_yamlObject



1084
1085
1086
1087
1088
# File 'lib/kube/ctl/string_builder.rb', line 1084

def test_kubectl_scale_replicas_3_f_foo_yaml
  result = Kube.ctl { scale.replicas(3).f 'foo.yaml' }
  assert_buffer(result, [["scale", []], ["replicas", [3]], ["f", ["foo.yaml"]]])
  assert_string(result, "scale --replicas=3 -f foo.yaml")
end

#test_kubectl_scale_replicas_3_job_cronObject



1102
1103
1104
1105
1106
# File 'lib/kube/ctl/string_builder.rb', line 1102

def test_kubectl_scale_replicas_3_job_cron
  result = Kube.ctl { scale.replicas(3).job/cron }
  assert_buffer(result, [["scale", []], ["replicas", [3]], ["job", []], :slash, ["cron", []]])
  assert_string(result, "scale --replicas=3 job/cron")
end

#test_kubectl_scale_replicas_3_rs_fooObject



1078
1079
1080
1081
1082
# File 'lib/kube/ctl/string_builder.rb', line 1078

def test_kubectl_scale_replicas_3_rs_foo
  result = Kube.ctl { scale.replicas(3).rs/foo }
  assert_buffer(result, [["scale", []], ["replicas", [3]], ["rs", []], :slash, ["foo", []]])
  assert_string(result, "scale --replicas=3 rs/foo")
end

#test_kubectl_scale_replicas_5_rc_foo_rc_bar_rc_bazObject



1096
1097
1098
1099
1100
# File 'lib/kube/ctl/string_builder.rb', line 1096

def test_kubectl_scale_replicas_5_rc_foo_rc_bar_rc_baz
  result = Kube.ctl { scale.replicas(5).rc/foo.rc/bar.rc/baz }
  assert_buffer(result, [["scale", []], ["replicas", [5]], ["rc", []], :slash, ["foo", []], ["rc", []], :slash, ["bar", []], ["rc", []], :slash, ["baz", []]])
  assert_string(result, "scale --replicas=5 rc/foo rc/bar rc/baz")
end

#test_kubectl_set_image_daemonset_abc_nginx_1_9_1Object



1264
1265
1266
1267
1268
# File 'lib/kube/ctl/string_builder.rb', line 1264

def test_kubectl_set_image_daemonset_abc_nginx_1_9_1
  result = Kube.ctl { set.image.daemonset.abc.('*=nginx:1.9.1') }
  assert_buffer(result, [["set", []], ["image", []], ["daemonset", []], ["abc", []], ["*=nginx:1.9.1", []]])
  assert_string(result, "set image daemonset abc *=nginx:1.9.1")
end

#test_kubectl_set_image_deployment_nginx_busybox_busybox_nginx_nginx_1_9_1Object



1252
1253
1254
1255
1256
# File 'lib/kube/ctl/string_builder.rb', line 1252

def test_kubectl_set_image_deployment_nginx_busybox_busybox_nginx_nginx_1_9_1
  result = Kube.ctl { set.image.deployment/nginx.('busybox=busybox').('nginx=nginx:1.9.1') }
  assert_buffer(result, [["set", []], ["image", []], ["deployment", []], :slash, ["nginx", []], ["busybox=busybox", []], ["nginx=nginx:1.9.1", []]])
  assert_string(result, "set image deployment/nginx busybox=busybox nginx=nginx:1.9.1")
end

#test_kubectl_set_image_deployments_rc_nginx_nginx_1_9_1_allObject



1258
1259
1260
1261
1262
# File 'lib/kube/ctl/string_builder.rb', line 1258

def test_kubectl_set_image_deployments_rc_nginx_nginx_1_9_1_all
  result = Kube.ctl { set.image.('deployments,rc').('nginx=nginx:1.9.1').all(true) }
  assert_buffer(result, [["set", []], ["image", []], ["deployments,rc", []], ["nginx=nginx:1.9.1", []], ["all", [true]]])
  assert_string(result, "set image deployments,rc nginx=nginx:1.9.1 --all")
end

#test_kubectl_set_image_f_path_to_file_yaml_nginx_nginx_1_9_1_local_o_yamlObject



1270
1271
1272
1273
1274
# File 'lib/kube/ctl/string_builder.rb', line 1270

def test_kubectl_set_image_f_path_to_file_yaml_nginx_nginx_1_9_1_local_o_yaml
  result = Kube.ctl { set.image.f('path/to/file.yaml').('nginx=nginx:1.9.1').local(true).o(:yaml) }
  assert_buffer(result, [["set", []], ["image", []], ["f", ["path/to/file.yaml"]], ["nginx=nginx:1.9.1", []], ["local", [true]], ["o", [:yaml]]])
  assert_string(result, "set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml")
end

#test_kubectl_set_resources_deployment_nginx_c_nginx_limits_cpu_200m_memory_512miObject



1276
1277
1278
1279
1280
# File 'lib/kube/ctl/string_builder.rb', line 1276

def test_kubectl_set_resources_deployment_nginx_c_nginx_limits_cpu_200m_memory_512mi
  result = Kube.ctl { set.resources.deployment.nginx.c(:nginx).limits('cpu=200m,memory=512Mi') }
  assert_buffer(result, [["set", []], ["resources", []], ["deployment", []], ["nginx", []], ["c", [:nginx]], ["limits", ["cpu=200m,memory=512Mi"]]])
  assert_string(result, "set resources deployment nginx -c nginx --limits=cpu=200m,memory=512Mi")
end

#test_kubectl_set_resources_deployment_nginx_limits_cpu_0_memory_0_requests_cpu_0_memory_0Object



1288
1289
1290
1291
1292
# File 'lib/kube/ctl/string_builder.rb', line 1288

def test_kubectl_set_resources_deployment_nginx_limits_cpu_0_memory_0_requests_cpu_0_memory_0
  result = Kube.ctl { set.resources.deployment.nginx.limits('cpu=0,memory=0').requests('cpu=0,memory=0') }
  assert_buffer(result, [["set", []], ["resources", []], ["deployment", []], ["nginx", []], ["limits", ["cpu=0,memory=0"]], ["requests", ["cpu=0,memory=0"]]])
  assert_string(result, "set resources deployment nginx --limits=cpu=0,memory=0 --requests=cpu=0,memory=0")
end

#test_kubectl_set_resources_deployment_nginx_limits_cpu_200m_memory_512mi_requests_cpu_100m_memory_256miObject



1282
1283
1284
1285
1286
# File 'lib/kube/ctl/string_builder.rb', line 1282

def test_kubectl_set_resources_deployment_nginx_limits_cpu_200m_memory_512mi_requests_cpu_100m_memory_256mi
  result = Kube.ctl { set.resources.deployment.nginx.limits('cpu=200m,memory=512Mi').requests('cpu=100m,memory=256Mi') }
  assert_buffer(result, [["set", []], ["resources", []], ["deployment", []], ["nginx", []], ["limits", ["cpu=200m,memory=512Mi"]], ["requests", ["cpu=100m,memory=256Mi"]]])
  assert_string(result, "set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi")
end

#test_kubectl_set_resources_f_path_to_file_yaml_limits_cpu_200m_memory_512mi_local_o_yamlObject



1294
1295
1296
1297
1298
# File 'lib/kube/ctl/string_builder.rb', line 1294

def test_kubectl_set_resources_f_path_to_file_yaml_limits_cpu_200m_memory_512mi_local_o_yaml
  result = Kube.ctl { set.resources.f('path/to/file.yaml').limits('cpu=200m,memory=512Mi').local(true).o(:yaml) }
  assert_buffer(result, [["set", []], ["resources", []], ["f", ["path/to/file.yaml"]], ["limits", ["cpu=200m,memory=512Mi"]], ["local", [true]], ["o", [:yaml]]])
  assert_string(result, "set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml")
end

#test_kubectl_set_subject_clusterrolebinding_admin_serviceaccount_namespace_serviceaccount1Object



1300
1301
1302
1303
1304
# File 'lib/kube/ctl/string_builder.rb', line 1300

def test_kubectl_set_subject_clusterrolebinding_admin_serviceaccount_namespace_serviceaccount1
  result = Kube.ctl { set.subject.clusterrolebinding.admin.serviceaccount('namespace:serviceaccount1') }
  assert_buffer(result, [["set", []], ["subject", []], ["clusterrolebinding", []], ["admin", []], ["serviceaccount", ["namespace:serviceaccount1"]]])
  assert_string(result, "set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1")
end

#test_kubectl_set_subject_rolebinding_admin_user_user1_user_user2_group_group1Object



1306
1307
1308
1309
1310
# File 'lib/kube/ctl/string_builder.rb', line 1306

def test_kubectl_set_subject_rolebinding_admin_user_user1_user_user2_group_group1
  result = Kube.ctl { set.subject.rolebinding.admin.user('user1').user('user2').group('group1') }
  assert_buffer(result, [["set", []], ["subject", []], ["rolebinding", []], ["admin", []], ["user", ["user1"]], ["user", ["user2"]], ["group", ["group1"]]])
  assert_string(result, "set subject rolebinding admin --user=user1 --user=user2 --group=group1")
end

#test_kubectl_stop_f_path_to_resourcesObject



1330
1331
1332
1333
1334
# File 'lib/kube/ctl/string_builder.rb', line 1330

def test_kubectl_stop_f_path_to_resources
  result = Kube.ctl { stop.f 'path/to/resources' }
  assert_buffer(result, [["stop", []], ["f", ["path/to/resources"]]])
  assert_string(result, "stop -f path/to/resources")
end

#test_kubectl_stop_f_service_jsonObject



1324
1325
1326
1327
1328
# File 'lib/kube/ctl/string_builder.rb', line 1324

def test_kubectl_stop_f_service_json
  result = Kube.ctl { stop.f 'service.json' }
  assert_buffer(result, [["stop", []], ["f", ["service.json"]]])
  assert_string(result, "stop -f service.json")
end

#test_kubectl_stop_pods_services_l_name_mylabelObject



1318
1319
1320
1321
1322
# File 'lib/kube/ctl/string_builder.rb', line 1318

def test_kubectl_stop_pods_services_l_name_mylabel
  result = Kube.ctl { stop.('pods,services').l(name: 'myLabel') }
  assert_buffer(result, [["stop", []], ["pods,services", []], ["l", [{name: "myLabel"}]]])
  assert_string(result, "stop pods,services -l name=myLabel")
end

#test_kubectl_stop_replicationcontroller_fooObject



1312
1313
1314
1315
1316
# File 'lib/kube/ctl/string_builder.rb', line 1312

def test_kubectl_stop_replicationcontroller_foo
  result = Kube.ctl { stop.replicationcontroller.foo }
  assert_buffer(result, [["stop", []], ["replicationcontroller", []], ["foo", []]])
  assert_string(result, "stop replicationcontroller foo")
end

#test_kubectl_taint_node_l_mylabel_x_dedicated_foo_prefernoscheduleObject



1342
1343
1344
1345
1346
# File 'lib/kube/ctl/string_builder.rb', line 1342

def test_kubectl_taint_node_l_mylabel_x_dedicated_foo_prefernoschedule
  result = Kube.ctl { taint.node.l(myLabel: 'X', dedicated: "foo:PreferNoSchedule")}
  assert_buffer(result, [["taint", []], ["node", []], ["l", [{myLabel: "X", dedicated: "foo:PreferNoSchedule"}]]])
  assert_string(result, "taint node -l myLabel=X dedicated=foo:PreferNoSchedule")
end

#test_kubectl_taint_nodes_foo_dedicated_special_user_noscheduleObject



1336
1337
1338
1339
1340
# File 'lib/kube/ctl/string_builder.rb', line 1336

def test_kubectl_taint_nodes_foo_dedicated_special_user_noschedule
  result = Kube.ctl { taint.nodes.foo.(dedicated: 'special-user:NoSchedule') }
  assert_buffer(result, [["taint", []], ["nodes", []], ["foo", []], [{dedicated: "special-user:NoSchedule"}]])
  assert_string(result, "taint nodes foo dedicated=special-user:NoSchedule")
end

#test_kubectl_top_nodeObject



1348
1349
1350
1351
1352
# File 'lib/kube/ctl/string_builder.rb', line 1348

def test_kubectl_top_node
  result = Kube.ctl { top.node }
  assert_buffer(result, [["top", []], ["node", []]])
  assert_string(result, "top node")
end

#test_kubectl_top_node_node_nameObject



1354
1355
1356
1357
1358
# File 'lib/kube/ctl/string_builder.rb', line 1354

def test_kubectl_top_node_node_name
  result = Kube.ctl { top.node.NODE_NAME }
  assert_buffer(result, [["top", []], ["node", []], ["NODE_NAME", []]])
  assert_string(result, "top node NODE_NAME")
end

#test_kubectl_top_podObject



1360
1361
1362
1363
1364
# File 'lib/kube/ctl/string_builder.rb', line 1360

def test_kubectl_top_pod
  result = Kube.ctl { top.pod }
  assert_buffer(result, [["top", []], ["pod", []]])
  assert_string(result, "top pod")
end

#test_kubectl_top_pod_l_name_mylabelObject



1378
1379
1380
1381
1382
# File 'lib/kube/ctl/string_builder.rb', line 1378

def test_kubectl_top_pod_l_name_mylabel
  result = Kube.ctl { top.pod.l(name: 'myLabel') }
  assert_buffer(result, [["top", []], ["pod", []], ["l", [{name: "myLabel"}]]])
  assert_string(result, "top pod -l name=myLabel")
end

#test_kubectl_top_pod_namespace_namespaceObject



1366
1367
1368
1369
1370
# File 'lib/kube/ctl/string_builder.rb', line 1366

def test_kubectl_top_pod_namespace_namespace
  result = Kube.ctl { top.pod.namespace('NAMESPACE') }
  assert_buffer(result, [["top", []], ["pod", []], ["namespace", ["NAMESPACE"]]])
  assert_string(result, "top pod --namespace=NAMESPACE")
end

#test_kubectl_top_pod_pod_name_containersObject



1372
1373
1374
1375
1376
# File 'lib/kube/ctl/string_builder.rb', line 1372

def test_kubectl_top_pod_pod_name_containers
  result = Kube.ctl { top.pod.POD_NAME.containers(true) }
  assert_buffer(result, [["top", []], ["pod", []], ["POD_NAME", []], ["containers", [true]]])
  assert_string(result, "top pod POD_NAME --containers")
end

#test_kubectl_uncordon_fooObject



1384
1385
1386
1387
1388
# File 'lib/kube/ctl/string_builder.rb', line 1384

def test_kubectl_uncordon_foo
  result = Kube.ctl { uncordon.foo }
  assert_buffer(result, [["uncordon", []], ["foo", []]])
  assert_string(result, "uncordon foo")
end

#test_kubectl_versionObject



1396
1397
1398
1399
1400
# File 'lib/kube/ctl/string_builder.rb', line 1396

def test_kubectl_version
  result = Kube.ctl { version }
  assert_buffer(result, [["version", []]])
  assert_string(result, "version")
end

#test_matches_known_command_chain_with_resource_segmentsObject



194
195
196
197
198
199
200
201
202
203
204
# File 'lib/kube/ctl/command_tree.rb', line 194

def test_matches_known_command_chain_with_resource_segments
  result = @tree.evaluate(Kube.ctl { get.deployment.v1.apps })

  assert_results(
    result,
    "get deployment.v1.apps",
    commands: ["get"],
    resources: ["deployment.v1.apps"],
    valid: true
  )
end

#test_method_with_arg_becomes_long_flag_after_commandObject



256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/kube/ctl/command_tree.rb', line 256

def test_method_with_arg_becomes_long_flag_after_command
  result = @tree.evaluate(Kube.ctl { get.deployment.v1.apps.namespace("default") })

  assert_results(
    result,
    "get deployment.v1.apps --namespace default",
    commands: ["get"],
    resources: ["deployment.v1.apps"],
    flags: ["--namespace default"],
    valid: true
  )
end

#test_resource_with_dots_and_unknown_namesObject



206
207
208
209
210
211
212
213
214
215
216
# File 'lib/kube/ctl/command_tree.rb', line 206

def test_resource_with_dots_and_unknown_names
  result = @tree.evaluate(Kube.ctl { get.cronjobs.v1.batch })

  assert_results(
    result,
    "get cronjobs.v1.batch",
    commands: ["get"],
    resources: ["cronjobs.v1.batch"],
    valid: true
  )
end

#test_rollout_restart_deployment_selectorObject



295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/kube/ctl/command_tree.rb', line 295

def test_rollout_restart_deployment_selector
  result = @tree.evaluate(Kube.ctl { rollout.restart.deployment.selector("app=nginx") })

  assert_results(
    result,
    "rollout restart deployment --selector app=nginx",
    commands: ["rollout", "restart"],
    resources: ["deployment"],
    flags: ["--selector app=nginx"],
    valid: true
  )
end

#test_rollout_undo_deployment_abcObject



321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/kube/ctl/command_tree.rb', line 321

def test_rollout_undo_deployment_abc
  result = @tree.evaluate(Kube.ctl { rollout.undo.deployment/abc })

  assert_results(
    result,
    "rollout undo deployment/abc",
    commands: ["rollout", "undo"],
    resources: ["deployment/abc"],
    flags: [],
    valid: true
  )
end

#test_unknown_root_command_returns_errorObject



218
219
220
221
222
223
224
225
226
227
228
# File 'lib/kube/ctl/command_tree.rb', line 218

def test_unknown_root_command_returns_error
  result = @tree.evaluate(Kube.ctl { definitely_missing })

  assert_results(
    result,
    commands: [],
    resources: ["definitely_missing"],
    errors: ["invalid command start: `definitely_missing`"],
    valid: false
  )
end