cuken 0.1.13 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/.rvmrc +61 -0
  2. data/Gemfile +17 -15
  3. data/Gemfile.lock +55 -63
  4. data/VERSION +1 -1
  5. data/cuken.gems +46 -0
  6. data/cuken.gemspec +85 -31
  7. data/features/about.md +4 -0
  8. data/features/avagrant_steps/vagrant_steps.feature +13 -0
  9. data/features/chef_examples/cookbooks_cookbook.feature +1 -1
  10. data/features/chef_examples/cookbooks_metadata.feature +5 -5
  11. data/features/chef_examples/cookbooks_repo.feature +1 -1
  12. data/features/chef_examples/knife_admin_client.feature +12 -12
  13. data/features/chef_examples/knife_client_create.feature +1 -1
  14. data/features/chef_examples/zenoss_example/01_chef_server_setup.feature +1 -1
  15. data/features/chef_examples/zenoss_example/02_monitor_vm_setup.feature +1 -1
  16. data/features/chef_steps/cookbook_steps.feature +6 -16
  17. data/features/command_examples/commands.feature +3 -3
  18. data/features/command_examples/exit_statuses.feature +49 -0
  19. data/features/command_examples/file_system_commands.feature +128 -0
  20. data/features/command_examples/flushing.feature +24 -0
  21. data/features/command_examples/interactive.feature +57 -0
  22. data/features/command_examples/no_clobber.feature +41 -0
  23. data/features/command_examples/output.feature +205 -0
  24. data/features/command_steps/command_steps.feature +49 -42
  25. data/features/file_examples/files.feature +5 -5
  26. data/features/git_examples/git_clone.feature +33 -0
  27. data/features/ssh_examples/ssh.feature +11 -2
  28. data/features/step_definitions/cuken_steps.rb +3 -2
  29. data/features/support/env.rb +2 -1
  30. data/lib/cuken/all.rb +1 -0
  31. data/lib/cuken/api/aruba/api.rb +342 -0
  32. data/lib/cuken/api/aruba/hooks.rb +63 -0
  33. data/lib/cuken/api/aruba/process.rb +74 -0
  34. data/lib/cuken/api/aruba.rb +5 -0
  35. data/lib/cuken/api/chef/common.rb +8 -1
  36. data/lib/cuken/api/chef/cookbook.rb +31 -5
  37. data/lib/cuken/api/chef/knife.rb +3 -3
  38. data/lib/cuken/api/chef/role.rb +3 -3
  39. data/lib/cuken/api/chef.rb +98 -9
  40. data/lib/cuken/api/cmd.rb +8 -8
  41. data/lib/cuken/api/common.rb +11 -23
  42. data/lib/cuken/api/file.rb +38 -38
  43. data/lib/cuken/api/git/clone.rb +25 -0
  44. data/lib/cuken/api/git/common.rb +37 -0
  45. data/lib/cuken/api/git/remote.rb +16 -0
  46. data/lib/cuken/api/git/repository.rb +62 -0
  47. data/lib/cuken/api/git.rb +69 -0
  48. data/lib/cuken/api/rvm/common.rb +10 -0
  49. data/lib/cuken/api/rvm/gemsets.rb +33 -0
  50. data/lib/cuken/api/rvm/wip.rb +554 -0
  51. data/lib/cuken/api/rvm.rb +25 -479
  52. data/lib/cuken/api/ssh.rb +85 -4
  53. data/lib/cuken/api/vagrant/common.rb +7 -4
  54. data/lib/cuken/api/vagrant/v_m.rb +2 -2
  55. data/lib/cuken/api/vagrant.rb +3 -3
  56. data/lib/cuken/common.rb +3 -1
  57. data/lib/cuken/cucumber/chef/common.rb +3 -3
  58. data/lib/cuken/cucumber/chef/cookbook/action.rb +81 -0
  59. data/lib/cuken/cucumber/chef/cookbook/local.rb +71 -0
  60. data/lib/cuken/cucumber/chef/cookbook/remote.rb +37 -0
  61. data/lib/cuken/cucumber/chef/cookbook.rb +3 -140
  62. data/lib/cuken/cucumber/chef/cookbook_steps.rb +1 -1
  63. data/lib/cuken/cucumber/chef/deploy_steps.rb +1 -1
  64. data/lib/cuken/cucumber/chef/done_directory_steps.rb +2 -2
  65. data/lib/cuken/cucumber/chef/done_file_steps.rb +5 -5
  66. data/lib/cuken/cucumber/chef/knife.rb +1 -1
  67. data/lib/cuken/cucumber/chef.rb +1 -1
  68. data/lib/cuken/cucumber/cmd/execution.rb +34 -0
  69. data/lib/cuken/cucumber/cmd/exit_status.rb +30 -0
  70. data/lib/cuken/cucumber/cmd.rb +2 -36
  71. data/lib/cuken/cucumber/common.rb +42 -6
  72. data/lib/cuken/cucumber/file.rb +42 -37
  73. data/lib/cuken/cucumber/git/clone.rb +51 -0
  74. data/lib/cuken/cucumber/git/common.rb +36 -0
  75. data/lib/cuken/cucumber/git/local.rb +19 -0
  76. data/lib/cuken/cucumber/git/remote.rb +22 -0
  77. data/lib/cuken/cucumber/git.rb +26 -0
  78. data/lib/cuken/cucumber/output/all.rb +41 -0
  79. data/lib/cuken/cucumber/output/cmd.rb +46 -0
  80. data/lib/cuken/cucumber/output/stderr.rb +33 -0
  81. data/lib/cuken/cucumber/output/stdout.rb +34 -0
  82. data/lib/cuken/cucumber/rvm/common.rb +0 -0
  83. data/lib/cuken/cucumber/rvm/gemsets.rb +32 -0
  84. data/lib/cuken/cucumber/rvm/hooks.rb +0 -0
  85. data/lib/cuken/cucumber/rvm.rb +3 -1
  86. data/lib/cuken/cucumber/ssh/common.rb +51 -0
  87. data/lib/cuken/cucumber/ssh.rb +3 -35
  88. data/lib/cuken/cucumber/vagrant.rb +1 -1
  89. data/lib/cuken/git.rb +21 -0
  90. data/spec/api/rvm/gemsets/api_spec.rb +41 -0
  91. data/spec/api/rvm/gemsets/helper_spec.rb +19 -0
  92. data/spec/api/rvm_spec.rb +63 -15
  93. data/spec/api/vagrant/v_m/Vagrantfile +82 -0
  94. data/spec/api/vagrant/v_m/api_spec.rb +37 -0
  95. data/spec/spec_helper.rb +39 -0
  96. metadata +123 -45
  97. data/spec/cuken_spec.rb +0 -7
data/cuken.gemspec CHANGED
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{cuken}
8
- s.version = "0.1.13"
7
+ s.name = "cuken"
8
+ s.version = "0.1.15"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Hedgehog"]
12
- s.date = %q{2011-05-03}
13
- s.description = %q{Reusable Cucumber steps and API for post-convergence system integration descriptions}
14
- s.email = %q{hedgehogshiatus@gmail.com}
12
+ s.date = "2011-10-17"
13
+ s.description = "Reusable Cucumber steps and API for post-convergence system integration descriptions"
14
+ s.email = "hedgehogshiatus@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
17
  "README.md"
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  ".document",
21
21
  ".relish",
22
22
  ".rspec",
23
+ ".rvmrc",
23
24
  "Gemfile",
24
25
  "Gemfile.lock",
25
26
  "LICENSE",
@@ -33,6 +34,7 @@ Gem::Specification.new do |s|
33
34
  "examples/chef/features/support/env.rb",
34
35
  "features/.nav",
35
36
  "features/about.md",
37
+ "features/avagrant_steps/vagrant_steps.feature",
36
38
  "features/chef_examples/cookbooks_cookbook.feature",
37
39
  "features/chef_examples/cookbooks_metadata.feature",
38
40
  "features/chef_examples/cookbooks_remote_repo.feature",
@@ -49,6 +51,12 @@ Gem::Specification.new do |s|
49
51
  "features/chef_steps/node_steps.feature",
50
52
  "features/chef_steps/role_steps.feature",
51
53
  "features/command_examples/commands.feature",
54
+ "features/command_examples/exit_statuses.feature",
55
+ "features/command_examples/file_system_commands.feature",
56
+ "features/command_examples/flushing.feature",
57
+ "features/command_examples/interactive.feature",
58
+ "features/command_examples/no_clobber.feature",
59
+ "features/command_examples/output.feature",
52
60
  "features/command_steps/command_steps.feature",
53
61
  "features/cuken.feature",
54
62
  "features/data/Rakefile",
@@ -398,12 +406,17 @@ Gem::Specification.new do |s|
398
406
  "features/file_examples/files.feature",
399
407
  "features/file_steps/file_steps.feature",
400
408
  "features/generic_steps/generic_steps.feature",
409
+ "features/git_examples/git_clone.feature",
401
410
  "features/ssh_examples/ssh.feature",
402
411
  "features/ssh_steps/ssh_steps.feature",
403
412
  "features/step_definitions/cuken_steps.rb",
404
413
  "features/support/env.rb",
405
414
  "lib/cuken.rb",
406
415
  "lib/cuken/all.rb",
416
+ "lib/cuken/api/aruba.rb",
417
+ "lib/cuken/api/aruba/api.rb",
418
+ "lib/cuken/api/aruba/hooks.rb",
419
+ "lib/cuken/api/aruba/process.rb",
407
420
  "lib/cuken/api/chef.rb",
408
421
  "lib/cuken/api/chef/common.rb",
409
422
  "lib/cuken/api/chef/cookbook.rb",
@@ -413,7 +426,15 @@ Gem::Specification.new do |s|
413
426
  "lib/cuken/api/cmd.rb",
414
427
  "lib/cuken/api/common.rb",
415
428
  "lib/cuken/api/file.rb",
429
+ "lib/cuken/api/git.rb",
430
+ "lib/cuken/api/git/clone.rb",
431
+ "lib/cuken/api/git/common.rb",
432
+ "lib/cuken/api/git/remote.rb",
433
+ "lib/cuken/api/git/repository.rb",
416
434
  "lib/cuken/api/rvm.rb",
435
+ "lib/cuken/api/rvm/common.rb",
436
+ "lib/cuken/api/rvm/gemsets.rb",
437
+ "lib/cuken/api/rvm/wip.rb",
417
438
  "lib/cuken/api/ssh-forever.rb",
418
439
  "lib/cuken/api/ssh.rb",
419
440
  "lib/cuken/api/ssh/password.rb",
@@ -426,6 +447,9 @@ Gem::Specification.new do |s|
426
447
  "lib/cuken/cucumber/chef.rb",
427
448
  "lib/cuken/cucumber/chef/common.rb",
428
449
  "lib/cuken/cucumber/chef/cookbook.rb",
450
+ "lib/cuken/cucumber/chef/cookbook/action.rb",
451
+ "lib/cuken/cucumber/chef/cookbook/local.rb",
452
+ "lib/cuken/cucumber/chef/cookbook/remote.rb",
429
453
  "lib/cuken/cucumber/chef/cookbook_steps.rb",
430
454
  "lib/cuken/cucumber/chef/data_bag.rb",
431
455
  "lib/cuken/cucumber/chef/deploy_steps.rb",
@@ -449,36 +473,57 @@ Gem::Specification.new do |s|
449
473
  "lib/cuken/cucumber/chef/search_steps.rb",
450
474
  "lib/cuken/cucumber/chef/webrat_steps.rb",
451
475
  "lib/cuken/cucumber/cmd.rb",
476
+ "lib/cuken/cucumber/cmd/execution.rb",
477
+ "lib/cuken/cucumber/cmd/exit_status.rb",
452
478
  "lib/cuken/cucumber/common.rb",
453
479
  "lib/cuken/cucumber/file.rb",
480
+ "lib/cuken/cucumber/git.rb",
481
+ "lib/cuken/cucumber/git/clone.rb",
482
+ "lib/cuken/cucumber/git/common.rb",
454
483
  "lib/cuken/cucumber/git/hooks.rb",
484
+ "lib/cuken/cucumber/git/local.rb",
485
+ "lib/cuken/cucumber/git/remote.rb",
486
+ "lib/cuken/cucumber/output/all.rb",
487
+ "lib/cuken/cucumber/output/cmd.rb",
488
+ "lib/cuken/cucumber/output/stderr.rb",
489
+ "lib/cuken/cucumber/output/stdout.rb",
455
490
  "lib/cuken/cucumber/rvm.rb",
491
+ "lib/cuken/cucumber/rvm/common.rb",
492
+ "lib/cuken/cucumber/rvm/gemsets.rb",
493
+ "lib/cuken/cucumber/rvm/hooks.rb",
456
494
  "lib/cuken/cucumber/ssh.rb",
495
+ "lib/cuken/cucumber/ssh/common.rb",
457
496
  "lib/cuken/cucumber/ssh/hooks.rb",
458
497
  "lib/cuken/cucumber/vagrant.rb",
459
498
  "lib/cuken/cucumber/vagrant/common.rb",
460
499
  "lib/cuken/cucumber/vagrant/hooks.rb",
461
500
  "lib/cuken/file.rb",
501
+ "lib/cuken/git.rb",
462
502
  "lib/cuken/rvm.rb",
463
503
  "lib/cuken/ssh.rb",
464
504
  "lib/cuken/vagrant.rb",
465
505
  "spec/api/knife_spec.rb",
506
+ "spec/api/rvm/gemsets/api_spec.rb",
507
+ "spec/api/rvm/gemsets/helper_spec.rb",
466
508
  "spec/api/rvm_spec.rb",
467
509
  "spec/api/rvmrc_processor_spec.rb",
468
- "spec/cuken_spec.rb",
510
+ "spec/api/vagrant/v_m/Vagrantfile",
511
+ "spec/api/vagrant/v_m/api_spec.rb",
469
512
  "spec/spec_helper.rb"
470
513
  ]
471
- s.homepage = %q{http://github.com/hedgehog/cuken}
514
+ s.homepage = "http://github.com/hedgehog/cuken"
472
515
  s.licenses = ["Apache 2.0"]
473
516
  s.require_paths = ["lib"]
474
- s.rubygems_version = %q{1.7.2}
475
- s.summary = %q{Reusable Cucumber steps and API for post-convergence system integration descriptions}
517
+ s.rubygems_version = "1.8.10"
518
+ s.summary = "Reusable Cucumber steps and API for post-convergence system integration descriptions"
476
519
  s.test_files = [
477
520
  "examples/chef/features/support/env.rb",
478
521
  "spec/api/knife_spec.rb",
522
+ "spec/api/rvm/gemsets/api_spec.rb",
523
+ "spec/api/rvm/gemsets/helper_spec.rb",
479
524
  "spec/api/rvm_spec.rb",
480
525
  "spec/api/rvmrc_processor_spec.rb",
481
- "spec/cuken_spec.rb",
526
+ "spec/api/vagrant/v_m/api_spec.rb",
482
527
  "spec/spec_helper.rb"
483
528
  ]
484
529
 
@@ -486,60 +531,69 @@ Gem::Specification.new do |s|
486
531
  s.specification_version = 3
487
532
 
488
533
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
489
- s.add_runtime_dependency(%q<aruba>, ["~> 0.3.6"])
490
- s.add_runtime_dependency(%q<cucumber>, [">= 0"])
491
534
  s.add_runtime_dependency(%q<chef>, ["~> 0.10.0"])
535
+ s.add_runtime_dependency(%q<childprocess>, [">= 0.1.7"])
536
+ s.add_runtime_dependency(%q<cucumber>, ["> 1.0.0"])
492
537
  s.add_runtime_dependency(%q<grit>, ["~> 2.4.1"])
493
- s.add_runtime_dependency(%q<rvm>, ["~> 1.5.2"])
494
538
  s.add_runtime_dependency(%q<open4>, [">= 0"])
495
- s.add_runtime_dependency(%q<vagrant>, ["~> 0.7.2"])
539
+ s.add_runtime_dependency(%q<rspec>, [">= 2.5.0"])
540
+ s.add_runtime_dependency(%q<rvm>, ["~> 1.8.0"])
541
+ s.add_runtime_dependency(%q<vagrant>, ["= 0.8.7"])
496
542
  s.add_development_dependency(%q<rr>, ["~> 1.0.2"])
497
- s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
543
+ s.add_development_dependency(%q<rspec>, [">= 2.5.0"])
544
+ s.add_development_dependency(%q<chef>, ["~> 0.10.0"])
545
+ s.add_development_dependency(%q<cucumber>, ["> 1.0.0"])
498
546
  s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
499
- s.add_development_dependency(%q<cucumber>, [">= 0"])
500
- s.add_development_dependency(%q<bundler>, ["~> 1.0.11"])
547
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.21"])
501
548
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
502
549
  s.add_development_dependency(%q<rcov>, [">= 0"])
503
550
  s.add_development_dependency(%q<reek>, ["~> 1.2.8"])
504
551
  s.add_development_dependency(%q<roodi>, ["~> 2.1.0"])
505
552
  s.add_development_dependency(%q<fakefs>, ["~> 0.3.1"])
553
+ s.add_development_dependency(%q<vagrant>, ["= 0.8.7"])
506
554
  else
507
- s.add_dependency(%q<aruba>, ["~> 0.3.6"])
508
- s.add_dependency(%q<cucumber>, [">= 0"])
509
555
  s.add_dependency(%q<chef>, ["~> 0.10.0"])
556
+ s.add_dependency(%q<childprocess>, [">= 0.1.7"])
557
+ s.add_dependency(%q<cucumber>, ["> 1.0.0"])
510
558
  s.add_dependency(%q<grit>, ["~> 2.4.1"])
511
- s.add_dependency(%q<rvm>, ["~> 1.5.2"])
512
559
  s.add_dependency(%q<open4>, [">= 0"])
513
- s.add_dependency(%q<vagrant>, ["~> 0.7.2"])
560
+ s.add_dependency(%q<rspec>, [">= 2.5.0"])
561
+ s.add_dependency(%q<rvm>, ["~> 1.8.0"])
562
+ s.add_dependency(%q<vagrant>, ["= 0.8.7"])
514
563
  s.add_dependency(%q<rr>, ["~> 1.0.2"])
515
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
564
+ s.add_dependency(%q<rspec>, [">= 2.5.0"])
565
+ s.add_dependency(%q<chef>, ["~> 0.10.0"])
566
+ s.add_dependency(%q<cucumber>, ["> 1.0.0"])
516
567
  s.add_dependency(%q<yard>, ["~> 0.6.0"])
517
- s.add_dependency(%q<cucumber>, [">= 0"])
518
- s.add_dependency(%q<bundler>, ["~> 1.0.11"])
568
+ s.add_dependency(%q<bundler>, ["~> 1.0.21"])
519
569
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
520
570
  s.add_dependency(%q<rcov>, [">= 0"])
521
571
  s.add_dependency(%q<reek>, ["~> 1.2.8"])
522
572
  s.add_dependency(%q<roodi>, ["~> 2.1.0"])
523
573
  s.add_dependency(%q<fakefs>, ["~> 0.3.1"])
574
+ s.add_dependency(%q<vagrant>, ["= 0.8.7"])
524
575
  end
525
576
  else
526
- s.add_dependency(%q<aruba>, ["~> 0.3.6"])
527
- s.add_dependency(%q<cucumber>, [">= 0"])
528
577
  s.add_dependency(%q<chef>, ["~> 0.10.0"])
578
+ s.add_dependency(%q<childprocess>, [">= 0.1.7"])
579
+ s.add_dependency(%q<cucumber>, ["> 1.0.0"])
529
580
  s.add_dependency(%q<grit>, ["~> 2.4.1"])
530
- s.add_dependency(%q<rvm>, ["~> 1.5.2"])
531
581
  s.add_dependency(%q<open4>, [">= 0"])
532
- s.add_dependency(%q<vagrant>, ["~> 0.7.2"])
582
+ s.add_dependency(%q<rspec>, [">= 2.5.0"])
583
+ s.add_dependency(%q<rvm>, ["~> 1.8.0"])
584
+ s.add_dependency(%q<vagrant>, ["= 0.8.7"])
533
585
  s.add_dependency(%q<rr>, ["~> 1.0.2"])
534
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
586
+ s.add_dependency(%q<rspec>, [">= 2.5.0"])
587
+ s.add_dependency(%q<chef>, ["~> 0.10.0"])
588
+ s.add_dependency(%q<cucumber>, ["> 1.0.0"])
535
589
  s.add_dependency(%q<yard>, ["~> 0.6.0"])
536
- s.add_dependency(%q<cucumber>, [">= 0"])
537
- s.add_dependency(%q<bundler>, ["~> 1.0.11"])
590
+ s.add_dependency(%q<bundler>, ["~> 1.0.21"])
538
591
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
539
592
  s.add_dependency(%q<rcov>, [">= 0"])
540
593
  s.add_dependency(%q<reek>, ["~> 1.2.8"])
541
594
  s.add_dependency(%q<roodi>, ["~> 2.1.0"])
542
595
  s.add_dependency(%q<fakefs>, ["~> 0.3.1"])
596
+ s.add_dependency(%q<vagrant>, ["= 0.8.7"])
543
597
  end
544
598
  end
545
599
 
data/features/about.md CHANGED
@@ -111,6 +111,10 @@ If you need to change a default hook, add your variation of the following to you
111
111
  @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 3600 ? @aruba_timeout_seconds = 3600 : @aruba_timeout_seconds
112
112
  end
113
113
 
114
+ Before('@ssh_local') do
115
+ @aruba_io_wait_seconds.nil? || @aruba_io_wait_seconds < 0.3 ? @aruba_io_wait_seconds = 0.3 : @aruba_io_wait_seconds
116
+ end
117
+
114
118
  ### Aruba
115
119
  Aruba will timeout if a command takes too long. A convention is to tag Features/Scenarios
116
120
  according to the size of the timeout threshold:
@@ -0,0 +1,13 @@
1
+ @chef @vagrant @step_features @announce
2
+ Feature: Vagrant steps
3
+ In order to test automated Chef deployments
4
+ As an administrator
5
+ I want to know what Vagrant steps are available
6
+
7
+ Background:
8
+ Given that "cuken/chef" has been required
9
+
10
+ Scenario: Vagrant
11
+ Then these steps are defined for "cuken/cucumber/vagrant.rb":
12
+ | step |
13
+ |the Vagrantfile "([^\"]*)" exists |
@@ -31,7 +31,7 @@ Feature: Cookbook Validity
31
31
  When I clone the Cookbooks:
32
32
  | cookbook | tag | destination |
33
33
  | hfgrt | 37s.0.1.0 | ckbk/scratch/myapp/cookbooks/hosts3 |
34
- Then the output should contain "Could not find Repository cookbooks/hfgrt"
34
+ Then the output contains "Could not find Repository cookbooks/hfgrt"
35
35
 
36
36
  Scenario: Clone multiple Cookbooks from a Cookbooks URI
37
37
  Given the remote Cookbooks URI "git://github.com/cookbooks/"
@@ -7,7 +7,7 @@ Feature: Cookbook Metadata
7
7
  Background:
8
8
  Given a default base Chef repository in "ckbk/scratch/myapp"
9
9
  And the local Chef repository exists
10
- And a file named "ckbk/scratch/myapp/.chef/knife.rb" with:
10
+ And the file "ckbk/scratch/myapp/.chef/knife.rb" contains:
11
11
  """
12
12
  current_dir = File.dirname(__FILE__)
13
13
  log_level :debug
@@ -27,15 +27,15 @@ Feature: Cookbook Metadata
27
27
 
28
28
  Scenario: Generate metadata for all cookbooks
29
29
  When I successfully generate all Cookbook metadata
30
- And the output should contain "DEBUG: Generated "
31
- And the output should not contain "DEBUG: No "
30
+ And the output contains "DEBUG: Generated "
31
+ And the output does not contain "DEBUG: No "
32
32
  Then the file "ckbk/scratch/myapp/cookbooks/hosts/metadata.json" exists
33
33
 
34
34
  Scenario: Generate metadata for a specific cookbook
35
35
  When we record the a-mtime of "ckbk/scratch/myapp/cookbooks/hosts/metadata.json"
36
36
  And I successfully generate Cookbook "hosts" metadata
37
- And the output should contain "DEBUG: Generated "
38
- And the output should not contain "DEBUG: No "
37
+ And the output contains "DEBUG: Generated "
38
+ And the output does not contain "DEBUG: No "
39
39
  Then the file "ckbk/scratch/myapp/cookbooks/hosts/metadata.json" exists
40
40
  And the mtime of "ckbk/scratch/myapp/cookbooks/hosts/metadata.json" changes
41
41
 
@@ -5,7 +5,7 @@ Feature: Clone local Chef repository for cookbooks
5
5
  I want to automatically clone a generic base Chef repository
6
6
 
7
7
  Background:
8
- Given a directory named "ckbk/scratch"
8
+ Given the directory "ckbk/scratch"
9
9
 
10
10
  Scenario: Clone a local Chef skeleton repository
11
11
  And the remote Chef repository "./../../features/data/repositories/chef-repo/.git"
@@ -15,8 +15,8 @@ Feature: Reusable Chef Knife steps
15
15
  Background:
16
16
  Given the Chef server URI "http://localhost:4000"
17
17
  And the Chef admin client "bobo-admin" exists
18
- And a directory named "foo/bar"
19
- And a file named "foo/bar/bobo-admin.pem" with:
18
+ And the directory "foo/bar"
19
+ And the file "foo/bar/bobo-admin.pem" contains:
20
20
  """
21
21
  -----BEGIN RSA PRIVATE KEY-----
22
22
  MIIEogIBAAKCAQEA2iu6ETTD3Ig/0dlbbQSPsVcSUGQ3O3Kgt+6h6OwD1HnQUHge
@@ -46,7 +46,7 @@ Feature: Reusable Chef Knife steps
46
46
  osFXY7fq6Hd9CEFLcDacyxXShu095MPJGTSBwwykWo+C+DUC5ts=
47
47
  -----END RSA PRIVATE KEY-----
48
48
  """
49
- And a file named "foo/bar/.chef/knife.rb" with:
49
+ And the file "foo/bar/.chef/knife.rb" contains:
50
50
  """
51
51
  current_dir = File.dirname(__FILE__)
52
52
  log_level :debug
@@ -63,7 +63,7 @@ Feature: Reusable Chef Knife steps
63
63
  Scenario: Knife steps default knife.rb path
64
64
  Given I cd to "foo/bar"
65
65
  When I successfully run `knife node list`
66
- Then the output should contain:
66
+ Then the output contains:
67
67
  """
68
68
  DEBUG: Signing the request as bobo-admin
69
69
  DEBUG: Sending HTTP Request via GET to localhost:4000/nodes
@@ -76,7 +76,7 @@ Feature: Reusable Chef Knife steps
76
76
  When the Nodes are:
77
77
  | node |
78
78
  | |
79
- Then the output should contain:
79
+ Then the output contains:
80
80
  """
81
81
  DEBUG: Signing the request as bobo-admin
82
82
  DEBUG: Sending HTTP Request via GET to localhost:4000/nodes
@@ -88,7 +88,7 @@ Feature: Reusable Chef Knife steps
88
88
  And I cd to "./../../"
89
89
  And a Cookbook path "features/data/cookbooks_not_uploaded_at_feature_start"
90
90
  When I successfully run Knife's "cookbook upload version_updated"
91
- Then the output should contain:
91
+ Then the output contains:
92
92
  """
93
93
  ERROR: Could not find cookbook version_updated in your cookbook path, skipping it
94
94
 
@@ -99,14 +99,14 @@ Feature: Reusable Chef Knife steps
99
99
  And I cd to "./../../"
100
100
  And a Cookbook path "features/data/repositories/cookbooks_not_uploaded_at_feature_start/version_updated"
101
101
  When I successfully run Knife's "cookbook upload version_updated"
102
- Then the output should contain "INFO: Uploading files"
103
- And the output should contain "DEBUG: Committing sandbox"
104
- And the output should contain "INFO: Upload complete!"
102
+ Then the output contains "INFO: Uploading files"
103
+ And the output contains "DEBUG: Committing sandbox"
104
+ And the output contains "INFO: Upload complete!"
105
105
 
106
106
  Scenario: Verify a cookbook with path to knife.rb created earlier
107
107
  Given the Knife file "foo/bar/.chef/knife.rb"
108
108
  And I successfully run Knife's "cookbook show version_updated"
109
- And the output should contain:
109
+ And the output contains:
110
110
  """
111
111
  DEBUG: Signing the request as bobo-admin
112
112
  DEBUG: Sending HTTP Request via GET to localhost:4000/cookbooks/version_updated
@@ -123,7 +123,7 @@ Feature: Reusable Chef Knife steps
123
123
  When I interactively run Knife's "cookbook delete version_updated"
124
124
  And I type "Y"
125
125
  And wait "5" seconds
126
- Then the output should contain:
126
+ Then the output contains:
127
127
  """
128
128
  DEBUG: Signing the request as bobo-admin
129
129
  DEBUG: Sending HTTP Request via GET to localhost:4000/cookbooks/version_updated
@@ -140,7 +140,7 @@ Feature: Reusable Chef Knife steps
140
140
  And I interactively run Knife's "cookbook delete version_updated 2.0.0"
141
141
  And I type "Y"
142
142
  And wait "5" seconds
143
- Then the output should contain:
143
+ Then the output contains:
144
144
  """
145
145
  Do you really want to delete version_updated version 2.0.0? (Y/N) DEBUG: Signing the request as bobo-admin
146
146
  DEBUG: Sending HTTP Request via DELETE to localhost:4000/cookbooks/version_updated/2.0.0
@@ -10,4 +10,4 @@
10
10
  #Background:
11
11
  # Given the Chef server URI "http://localhost:4000"
12
12
  # And the Chef admin client "bobo-admin" exists
13
- # And a directory named "foo/bar"
13
+ # And the directory "foo/bar"
@@ -191,7 +191,7 @@ Feature: 01) Chef-Server VM
191
191
  And I type "sudo chmod 0644 /etc/chef/certificates/key.pem"
192
192
  And I type "stat -c %A /etc/chef/webui.pem"
193
193
  And I type "stat -c %A /etc/chef/certificates/key.pem"
194
- Then the output should contain:
194
+ Then the output contains:
195
195
  """
196
196
  -rw-r--r--
197
197
  -rw-r--r--
@@ -95,7 +95,7 @@ Feature: 02) Prepare Monitor VM
95
95
 
96
96
  Scenario: Configure Knife file for the Monitor's client certificate
97
97
  Given the directory ".chef"
98
- And a file named ".chef/knife.rb" with:
98
+ And the file ".chef/knife.rb" contains:
99
99
  """
100
100
  current_dir = File.dirname(__FILE__)
101
101
  user = ENV['CHEF_USER'] || ENV['OPSCODE_USER'] || ENV['USER'] || `whoami`
@@ -7,17 +7,8 @@ Feature: Cookbook steps
7
7
  Background:
8
8
  Given that "cuken/chef" has been required
9
9
 
10
- Scenario: Generic Cookbook steps
11
- Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
12
- | step |
13
- |a Cookbook path "([^"]*)" |
14
- |a Cookbooks path "([^"]*)" |
15
- |I successfully generate all Cookbook metadata |
16
- |I successfully generate Cookbook "([^"]*)" metadata |
17
- |the local Cookbook "([^"]*)" exists |
18
-
19
10
  Scenario: Cookbook action steps
20
- Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
11
+ Then these steps are defined for "cuken/cucumber/chef/cookbook/action.rb":
21
12
  | step |
22
13
  |I clone the remote Cookbook repository branch "([^"]*)" to "([^"]*)" |
23
14
  |I clone the Cookbook "([^"]*)" branch "([^"]*)" to "([^"]*)" |
@@ -27,14 +18,13 @@ Feature: Cookbook steps
27
18
  |I successfully generate Cookbook "([^"]*)" metadata |
28
19
 
29
20
  Scenario: Local Cookbook and repository commands
30
- Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
21
+ Then these steps are defined for "cuken/cucumber/chef/cookbook/local.rb":
31
22
  | step |
23
+ |a Cookbook path "([^"]*)" |
24
+ |a Cookbooks path "([^"]*)" |
25
+ |the local Cookbook "([^"]*)" exists |
32
26
  |the local Cookbook repository "([^"]*)" |
33
27
  |the local Cookbook repository exists |
34
- |these local Cookbooks exist: |
35
- |the local Cookbook repository "([^"]*)" |
36
- |the local Cookbook repository exists |
37
- |the local Cookbook "([^"]*)" exists |
38
28
  |the local Site\-Cookbook "([^"]*)" exists |
39
29
  |the local Site\-Cookbook repository exists |
40
30
  |these local Cookbooks exist: |
@@ -42,7 +32,7 @@ Feature: Cookbook steps
42
32
  |these local Site\-Cookbooks exist: |
43
33
 
44
34
  Scenario: Remote Cookbook and repository commands
45
- Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
35
+ Then these steps are defined for "cuken/cucumber/chef/cookbook/remote.rb":
46
36
  | step |
47
37
  |the remote Cookbook repository "([^"]*)" |
48
38
  |the remote Cookbooks URI "([^"]*)" |
@@ -11,15 +11,15 @@ Feature: Executing commands
11
11
 
12
12
  Scenario: Check Stdout
13
13
  When I run `echo 'i like cheese'`
14
- Then the stdout from "echo 'i like cheese'" should contain "i like cheese"
14
+ Then the stdout from "echo 'i like cheese'" contains "i like cheese"
15
15
 
16
16
  Scenario: Check Stderr
17
17
  When I run `some_error`
18
- Then the stderr from "some_error" should contain "No such file or directory - some_error"
18
+ Then the stderr from "some_error" contains "No such file or directory - some_error"
19
19
 
20
20
  Scenario: Check Stdout for multiple lines
21
21
  When I run `echo 'one\none\none\n'`
22
- Then the output should contain:
22
+ Then the output contains:
23
23
  """
24
24
  one
25
25
  one
@@ -0,0 +1,49 @@
1
+ Feature: exit statuses
2
+
3
+ In order to specify expected exit statuses
4
+ As a developer using Cucumber
5
+ I want to use the "the exit status should be" step
6
+
7
+ Scenario: exit status of 0
8
+ When I run `ruby -h`
9
+ Then the exit status should be 0
10
+
11
+ Scenario: exit status of 0 with `
12
+ When I run `ruby -h`
13
+ Then the exit status should be 0
14
+
15
+ Scenario: Not explicitly exiting at all
16
+ When I run `ruby -e '42'`
17
+ Then the exit status should be 0
18
+
19
+ Scenario: non-zero exit status
20
+ When I run `ruby -e 'exit 56'`
21
+ Then the exit status should be 56
22
+ And the exit status should not be 0
23
+
24
+ Scenario: Successfully run something
25
+ When I successfully run `ruby -e 'exit 0'`
26
+
27
+ Scenario: run something somewhere not yet existing outside Aruba's scratch
28
+ When I successfully run `pwd` in "/tmp/just/created"
29
+ Then the output should contain:
30
+ """
31
+ /tmp/just/created
32
+ """
33
+ And I successfully run `rm -rf /tmp/just/created`
34
+
35
+ Scenario: Successfully run something with `
36
+ When I successfully run `ruby -e 'exit 0'`
37
+
38
+ Scenario: Unsuccessfully run something
39
+ When I do aruba I successfully run `ruby -e 'exit 10'`
40
+ Then aruba should fail with "Exit status was 10"
41
+
42
+ Scenario: Try to run something that doesn't exist
43
+ When I run `does_not_exist`
44
+ Then the exit status should be 1
45
+
46
+ Scenario: Try to run something that doesn't exist somewhere that does not exist outside Aruba's scratch
47
+ When I run `does_not_exist` in "/tmp/in/the/blue/moon"
48
+ Then the exit status should be 1
49
+ And I successfully run `rm -rf /tmp/in/the/blue/moon`