aruba 0.9.0.pre → 0.9.0.pre2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +8 -3
  3. data/History.md +61 -19
  4. data/README.md +10 -6
  5. data/TODO.md +6 -1
  6. data/cucumber.yml +10 -6
  7. data/features/.nav +72 -0
  8. data/features/announce.feature +203 -0
  9. data/features/api/command/extract_text.feature +10 -0
  10. data/features/api/command/run.feature +6 -6
  11. data/features/api/command/stop_all_commands.feature +53 -0
  12. data/features/api/command/terminate_all_commands.feature +53 -0
  13. data/features/api/command/unescape_text.feature +12 -0
  14. data/features/api/command/which.feature +3 -3
  15. data/features/api/core/expand_path.feature +4 -4
  16. data/features/api/environment/append_environment_variable.feature +18 -8
  17. data/features/api/environment/prepend_environment_variable.feature +18 -8
  18. data/features/api/environment/set_environment_variable.feature +33 -16
  19. data/features/api/filesystem/cd.feature +23 -13
  20. data/features/api/filesystem/create_directory.feature +2 -2
  21. data/features/api/filesystem/disk_usage.feature +7 -6
  22. data/features/api/filesystem/does_exist.feature +2 -2
  23. data/features/api/filesystem/is_absolute.feature +2 -2
  24. data/features/api/filesystem/is_directory.feature +2 -2
  25. data/features/api/filesystem/is_file.feature +2 -2
  26. data/features/api/filesystem/is_relative.feature +2 -2
  27. data/features/api/filesystem/move.feature +119 -0
  28. data/features/cli/console.feature +3 -3
  29. data/features/commands/debug_command.feature +93 -0
  30. data/features/commands/environment_variables.feature +64 -0
  31. data/features/commands/flushing.feature +74 -0
  32. data/features/commands/interactive.feature +90 -0
  33. data/features/commands/output/all_output.feature +445 -0
  34. data/features/commands/output/stdout.feature +66 -0
  35. data/features/configuration/exit_timeout.feature +5 -5
  36. data/features/configuration/fixtures_directories.feature +3 -3
  37. data/features/configuration/fixtures_path_prefix.feature +1 -1
  38. data/features/configuration/home_directory.feature +4 -4
  39. data/features/configuration/io_timeout.feature +2 -2
  40. data/features/configuration/keep_ansi.feature +2 -2
  41. data/features/configuration/log_level.feature +3 -3
  42. data/features/configuration/physical_block_size.feature +3 -3
  43. data/features/configuration/usage.feature +159 -0
  44. data/features/core/cleanup_aruba_directory.feature +52 -0
  45. data/features/development/build.feature +16 -0
  46. data/features/development/test.feature +24 -0
  47. data/features/file_system_commands.feature +12 -12
  48. data/features/getting_started/supported_programming_languages.feature +89 -0
  49. data/features/hooks/after/command.feature +1 -1
  50. data/features/hooks/before/command.feature +2 -2
  51. data/features/matchers/collection/include_an_object.feature +72 -0
  52. data/features/matchers/timeouts.feature +2 -2
  53. data/features/output.feature +60 -181
  54. data/features/step_definitions/aruba_dev_steps.rb +17 -10
  55. data/features/step_definitions/hooks.rb +11 -0
  56. data/features/steps/commands/exit_statuses.feature +3 -3
  57. data/features/steps/commands/run.feature +0 -15
  58. data/features/steps/filesystem/copy.feature +45 -0
  59. data/features/steps/filesystem/create_directory.feature +47 -0
  60. data/features/steps/filesystem/create_file.feature +53 -0
  61. data/features/steps/filesystem/file_content.feature +1 -1
  62. data/features/steps/filesystem/move.feature +45 -0
  63. data/features/steps/filesystem/overwrite_file.feature +72 -0
  64. data/features/steps/filesystem/use_fixture.feature +77 -0
  65. data/features/usage/install.feature +8 -0
  66. data/{features/fixtures → fixtures}/cli-app/.gitignore +0 -0
  67. data/{features/fixtures → fixtures}/cli-app/.rspec +0 -0
  68. data/{features/fixtures → fixtures}/cli-app/README.md +0 -0
  69. data/{features/fixtures → fixtures}/cli-app/Rakefile +0 -0
  70. data/{features/fixtures → fixtures}/cli-app/bin/cli +0 -0
  71. data/{features/fixtures → fixtures}/cli-app/cli-app.gemspec +0 -0
  72. data/{features/fixtures → fixtures}/cli-app/features/support/env.rb +0 -0
  73. data/{features/fixtures → fixtures}/cli-app/lib/cli/app.rb +0 -0
  74. data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +15 -0
  75. data/{features/fixtures → fixtures}/cli-app/lib/cli/app/version.rb +0 -0
  76. data/{features/fixtures/empty-app → fixtures/cli-app}/script/console +3 -3
  77. data/{features/fixtures → fixtures}/cli-app/spec/spec_helper.rb +0 -0
  78. data/{features/fixtures → fixtures}/cli-app/spec/support/aruba.rb +0 -0
  79. data/{features/fixtures → fixtures}/copy/file.txt +0 -0
  80. data/{features/fixtures → fixtures}/empty-app/.gitignore +0 -0
  81. data/{features/fixtures → fixtures}/empty-app/.rspec +0 -0
  82. data/{features/fixtures → fixtures}/empty-app/README.md +0 -0
  83. data/{features/fixtures → fixtures}/empty-app/Rakefile +0 -0
  84. data/{features/fixtures → fixtures}/empty-app/bin/cli +0 -0
  85. data/{features/fixtures → fixtures}/empty-app/cli-app.gemspec +0 -0
  86. data/{features/fixtures → fixtures}/empty-app/lib/cli/app.rb +0 -0
  87. data/{features/fixtures → fixtures}/empty-app/lib/cli/app/version.rb +0 -0
  88. data/{features/fixtures/cli-app → fixtures/empty-app}/script/console +3 -3
  89. data/{features/fixtures → fixtures}/empty-app/spec/spec_helper.rb +0 -0
  90. data/{features/fixtures → fixtures}/fixtures-app/test.txt +0 -0
  91. data/fixtures/getting-started-app/.gitignore +4 -0
  92. data/fixtures/getting-started-app/Gemfile +4 -0
  93. data/fixtures/getting-started-app/README.md +3 -0
  94. data/fixtures/getting-started-app/features/support/env.rb +1 -0
  95. data/{features/fixtures → fixtures}/spawn_process/stderr.sh +0 -0
  96. data/lib/aruba/announcer.rb +6 -2
  97. data/lib/aruba/api.rb +0 -16
  98. data/lib/aruba/api/command.rb +64 -266
  99. data/lib/aruba/api/core.rb +24 -26
  100. data/lib/aruba/api/deprecated.rb +370 -12
  101. data/lib/aruba/api/filesystem.rb +64 -15
  102. data/lib/aruba/aruba_path.rb +4 -0
  103. data/lib/aruba/config.rb +1 -1
  104. data/lib/aruba/cucumber.rb +5 -449
  105. data/lib/aruba/cucumber/command.rb +378 -0
  106. data/lib/aruba/cucumber/core.rb +29 -0
  107. data/lib/aruba/cucumber/environment.rb +30 -0
  108. data/lib/aruba/cucumber/file.rb +210 -0
  109. data/lib/aruba/cucumber/hooks.rb +11 -14
  110. data/lib/aruba/cucumber/rvm.rb +3 -0
  111. data/lib/aruba/matchers/base/base_matcher.rb +94 -0
  112. data/lib/aruba/matchers/collection.rb +1 -0
  113. data/lib/aruba/matchers/collection/all_objects.rb +2 -0
  114. data/lib/aruba/matchers/collection/include_an_object.rb +120 -0
  115. data/lib/aruba/matchers/command/be_successfully_executed.rb +3 -3
  116. data/lib/aruba/matchers/command/have_exit_status.rb +2 -11
  117. data/lib/aruba/matchers/command/have_finished_in_time.rb +5 -5
  118. data/lib/aruba/matchers/command/have_output.rb +46 -0
  119. data/lib/aruba/matchers/command/have_output_on_stderr.rb +42 -0
  120. data/lib/aruba/matchers/command/have_output_on_stdout.rb +42 -0
  121. data/lib/aruba/matchers/command/have_output_size.rb +28 -0
  122. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +1 -1
  123. data/lib/aruba/matchers/file/be_an_existing_file.rb +1 -1
  124. data/lib/aruba/matchers/file/have_file_content.rb +1 -1
  125. data/lib/aruba/matchers/file/have_file_size.rb +2 -2
  126. data/lib/aruba/matchers/file/have_same_file_content.rb +1 -1
  127. data/lib/aruba/matchers/path/have_permissions.rb +1 -1
  128. data/lib/aruba/platforms/aruba_file_creator.rb +2 -3
  129. data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +2 -3
  130. data/lib/aruba/platforms/determine_disk_usage.rb +23 -0
  131. data/lib/aruba/platforms/determine_file_size.rb +13 -0
  132. data/lib/aruba/platforms/disk_usage_calculator.rb +11 -0
  133. data/lib/aruba/platforms/local_environment.rb +15 -0
  134. data/lib/aruba/platforms/unix_environment_variables.rb +1 -1
  135. data/lib/aruba/platforms/unix_platform.rb +35 -14
  136. data/lib/aruba/process_monitor.rb +53 -7
  137. data/lib/aruba/processes/basic_process.rb +25 -5
  138. data/lib/aruba/processes/debug_process.rb +27 -25
  139. data/lib/aruba/processes/in_process.rb +7 -22
  140. data/lib/aruba/processes/spawn_process.rb +74 -31
  141. data/lib/aruba/rspec.rb +1 -6
  142. data/lib/aruba/version.rb +1 -1
  143. data/script/console +0 -1
  144. data/spec/aruba/api/environment/restore_env_spec.rb +65 -0
  145. data/spec/aruba/api/environment/set_env_spec.rb +42 -0
  146. data/spec/aruba/api/filesystem/file_size_spec.rb +28 -0
  147. data/spec/aruba/api_spec.rb +10 -7
  148. data/spec/aruba/matchers/command/have_output_size_spec.rb +25 -0
  149. data/spec/aruba/matchers/command_spec.rb +135 -4
  150. data/spec/aruba/spawn_process_spec.rb +1 -1
  151. metadata +107 -65
  152. data/.nav +0 -12
  153. data/features/debug.feature +0 -15
  154. data/features/fixtures/cli-app/spec/cli/app_spec.rb +0 -7
  155. data/features/flushing.feature +0 -26
  156. data/features/interactive.feature +0 -66
  157. data/features/no_clobber.feature +0 -25
  158. data/lib/aruba/disk_usage_calculator.rb +0 -7
@@ -18,6 +18,8 @@ Feature: Extract text from output
18
18
 
19
19
  RSpec.describe 'Run command', :type => :aruba do
20
20
  before(:each) { run('cli') }
21
+ before(:each) { stop_all_commands }
22
+
21
23
  it { expect(extract_text(unescape_text(last_command.output))).to eq "Text" }
22
24
  end
23
25
  """
@@ -36,6 +38,8 @@ Feature: Extract text from output
36
38
 
37
39
  RSpec.describe 'Run command', :type => :aruba do
38
40
  before(:each) { run('cli') }
41
+ before(:each) { stop_all_commands }
42
+
39
43
  it { expect(extract_text(unescape_text(last_command.output))).to eq "Text" }
40
44
  end
41
45
  """
@@ -54,6 +58,8 @@ Feature: Extract text from output
54
58
  #
55
59
  # RSpec.describe 'Run command', :type => :aruba do
56
60
  # before(:each) { run('cli') }
61
+ # before(:each) { stop_all_commands }
62
+ #
57
63
  # it { expect(extract_text(unescape_text(last_command.output))).to eq "Text" }
58
64
  # end
59
65
  # """
@@ -72,6 +78,8 @@ Feature: Extract text from output
72
78
  #
73
79
  # RSpec.describe 'Run command', :type => :aruba do
74
80
  # before(:each) { run('cli') }
81
+ # before(:each) { stop_all_commands }
82
+ #
75
83
  # it { expect(extract_text(unescape_text(last_command.output))).to eq "Text" }
76
84
  # end
77
85
  # """
@@ -90,6 +98,8 @@ Feature: Extract text from output
90
98
  #
91
99
  # RSpec.describe 'Run command', :type => :aruba do
92
100
  # before(:each) { run('cli') }
101
+ # before(:each) { stop_all_commands }
102
+ #
93
103
  # it { expect(extract_text(unescape_text(last_command.output))).to eq "Text" }
94
104
  # end
95
105
  # """
@@ -7,17 +7,17 @@ Feature: Run command
7
7
 
8
8
  Scenario: Existing executable
9
9
  Given an executable named "bin/cli" with:
10
- """
10
+ """bash
11
11
  #!/bin/bash
12
12
  exit 0
13
13
  """
14
- And a file named "spec/which_spec.rb" with:
15
- """
14
+ And a file named "spec/run_spec.rb" with:
15
+ """ruby
16
16
  require 'spec_helper'
17
17
 
18
18
  RSpec.describe 'Run command', :type => :aruba do
19
19
  before(:each) { run('cli') }
20
- it { expect(last_command).to be_successfully_executed }
20
+ it { expect(last_command_started).to be_successfully_executed }
21
21
  end
22
22
  """
23
23
  When I run `rspec`
@@ -25,8 +25,8 @@ Feature: Run command
25
25
 
26
26
  Scenario: Non-existing executable
27
27
  Given a file named "bin/cli" does not exist
28
- And a file named "spec/which_spec.rb" with:
29
- """
28
+ And a file named "spec/run_spec.rb" with:
29
+ """ruby
30
30
  require 'spec_helper'
31
31
 
32
32
  RSpec.describe 'Find path for command', :type => :aruba do
@@ -0,0 +1,53 @@
1
+ Feature: Stop all commands
2
+
3
+ To stop all running commands use the `#stop_all_commands`-method.
4
+
5
+ Background:
6
+ Given I use a fixture named "cli-app"
7
+
8
+ Scenario: Multiple commands are running
9
+ Given an executable named "bin/cli" with:
10
+ """bash
11
+ #!/bin/bash
12
+ sleep 3
13
+ """
14
+ And a file named "spec/run_spec.rb" with:
15
+ """ruby
16
+ require 'spec_helper'
17
+
18
+ RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 5 do
19
+ before(:each) { run('cli') }
20
+ before(:each) { run('cli') }
21
+
22
+ before(:each) { stop_all_commands }
23
+
24
+ it { expect(all_commands).to all be_stopped }
25
+ end
26
+ """
27
+ When I run `rspec`
28
+ Then the specs should all pass
29
+
30
+ Scenario: Stop all commands for which the block returns true
31
+ Given an executable named "bin/cli" with:
32
+ """bash
33
+ #!/bin/bash
34
+ sleep 1
35
+ """
36
+ And a file named "spec/run_spec.rb" with:
37
+ """ruby
38
+ require 'spec_helper'
39
+
40
+ RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 2 do
41
+ before(:each) { @cmd1 = run('cli') }
42
+ before(:each) { @cmd2 = run('cli') }
43
+ before(:each) { @cmd3 = run('sleep 1') }
44
+
45
+ before(:each) { stop_all_commands { |c| c.commandline == 'cli' } }
46
+
47
+ it { expect(@cmd1).to be_stopped }
48
+ it { expect(@cmd2).to be_stopped }
49
+ it { expect(@cmd3).not_to be_stopped }
50
+ end
51
+ """
52
+ When I run `rspec`
53
+ Then the specs should all pass
@@ -0,0 +1,53 @@
1
+ Feature: Terminate all commands
2
+
3
+ To terminate all running commands use the `#terminate_all_commands`-method.
4
+
5
+ Background:
6
+ Given I use a fixture named "cli-app"
7
+
8
+ Scenario: Multiple commands are running
9
+ Given an executable named "bin/cli" with:
10
+ """bash
11
+ #!/bin/bash
12
+ sleep 3
13
+ """
14
+ And a file named "spec/run_spec.rb" with:
15
+ """ruby
16
+ require 'spec_helper'
17
+
18
+ RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 5 do
19
+ before(:each) { run('cli') }
20
+ before(:each) { run('cli') }
21
+
22
+ before(:each) { terminate_all_commands }
23
+
24
+ it { expect(all_commands).to all be_stopped }
25
+ end
26
+ """
27
+ When I run `rspec`
28
+ Then the specs should all pass
29
+
30
+ Scenario: Terminate all commands for which the block returns true
31
+ Given an executable named "bin/cli" with:
32
+ """bash
33
+ #!/bin/bash
34
+ sleep 1
35
+ """
36
+ And a file named "spec/run_spec.rb" with:
37
+ """ruby
38
+ require 'spec_helper'
39
+
40
+ RSpec.describe 'Run command', :type => :aruba, :exit_timeout => 2 do
41
+ before(:each) { @cmd1 = run('cli') }
42
+ before(:each) { @cmd2 = run('cli') }
43
+ before(:each) { @cmd3 = run('sleep 1') }
44
+
45
+ before(:each) { terminate_all_commands { |c| c.commandline == 'cli' } }
46
+
47
+ it { expect(@cmd1).to be_stopped }
48
+ it { expect(@cmd2).to be_stopped }
49
+ it { expect(@cmd3).not_to be_stopped }
50
+ end
51
+ """
52
+ When I run `rspec`
53
+ Then the specs should all pass
@@ -22,6 +22,8 @@ Feature: Extract text from output
22
22
 
23
23
  RSpec.describe 'Run command', :type => :aruba do
24
24
  before(:each) { run('cli') }
25
+ before(:each) { stop_all_commands }
26
+
25
27
  it { expect(unescape_text(last_command.output)).to eq "text\ntext" }
26
28
  end
27
29
  """
@@ -40,6 +42,8 @@ Feature: Extract text from output
40
42
 
41
43
  RSpec.describe 'Run command', :type => :aruba do
42
44
  before(:each) { run('cli') }
45
+ before(:each) { stop_all_commands }
46
+
43
47
  it { expect(unescape_text(last_command.output)).to eq "texttext" }
44
48
  end
45
49
  """
@@ -58,6 +62,8 @@ Feature: Extract text from output
58
62
 
59
63
  RSpec.describe 'Run command', :type => :aruba do
60
64
  before(:each) { run('cli') }
65
+ before(:each) { stop_all_commands }
66
+
61
67
  it { expect(unescape_text(last_command.output)).to eq "text\"text" }
62
68
  end
63
69
  """
@@ -76,6 +82,8 @@ Feature: Extract text from output
76
82
 
77
83
  RSpec.describe 'Run command', :type => :aruba do
78
84
  before(:each) { run('cli') }
85
+ before(:each) { stop_all_commands }
86
+
79
87
  it { expect(unescape_text(last_command.output)).to eq "texttext" }
80
88
  end
81
89
  """
@@ -94,6 +102,8 @@ Feature: Extract text from output
94
102
 
95
103
  RSpec.describe 'Run command', :type => :aruba do
96
104
  before(:each) { run('cli') }
105
+ before(:each) { stop_all_commands }
106
+
97
107
  it { expect(unescape_text(last_command.output)).to eq "texttext" }
98
108
  end
99
109
  """
@@ -112,6 +122,8 @@ Feature: Extract text from output
112
122
 
113
123
  RSpec.describe 'Run command', :type => :aruba do
114
124
  before(:each) { run('cli') }
125
+ before(:each) { stop_all_commands }
126
+
115
127
  it { expect(unescape_text(last_command.output)).to eq "texttext" }
116
128
  end
117
129
  """
@@ -8,12 +8,12 @@ Feature: Get path to command
8
8
 
9
9
  Scenario: Existing executable
10
10
  Given an executable named "bin/cli" with:
11
- """
11
+ """bash
12
12
  #!/bin/bash
13
13
  exit 0
14
14
  """
15
15
  And a file named "spec/which_spec.rb" with:
16
- """
16
+ """ruby
17
17
  require 'spec_helper'
18
18
 
19
19
  RSpec.describe 'Find path for command', :type => :aruba do
@@ -26,7 +26,7 @@ Feature: Get path to command
26
26
  Scenario: Non-existing executable
27
27
  Given a file named "bin/cli" does not exist
28
28
  And a file named "spec/which_spec.rb" with:
29
- """
29
+ """ruby
30
30
  require 'spec_helper'
31
31
 
32
32
  RSpec.describe 'Find path for command', :type => :aruba do
@@ -9,7 +9,7 @@ Feature: Expand paths with aruba
9
9
 
10
10
  Scenario: Use relative path
11
11
  Given a file named "spec/expand_path_spec.rb" with:
12
- """
12
+ """ruby
13
13
  require 'spec_helper'
14
14
 
15
15
  RSpec.describe 'Expand path', :type => :aruba do
@@ -22,7 +22,7 @@ Feature: Expand paths with aruba
22
22
 
23
23
  Scenario: Change directory using cd
24
24
  Given a file named "spec/expand_path_spec.rb" with:
25
- """
25
+ """ruby
26
26
  require 'spec_helper'
27
27
 
28
28
  RSpec.describe 'Expand path', :type => :aruba do
@@ -40,7 +40,7 @@ Feature: Expand paths with aruba
40
40
 
41
41
  Scenario: Warn if aruba's working directory does not exist
42
42
  Given a file named "spec/expand_path_spec.rb" with:
43
- """
43
+ """ruby
44
44
  require 'spec_helper'
45
45
 
46
46
  RSpec.describe 'Expand path', :type => :aruba do
@@ -62,7 +62,7 @@ Feature: Expand paths with aruba
62
62
  you need to configure it explicitly via `Aruba.configure {}`.
63
63
 
64
64
  Given a file named "spec/expand_path_spec.rb" with:
65
- """
65
+ """ruby
66
66
  require 'spec_helper'
67
67
 
68
68
  # Old before 1.0.0
@@ -15,14 +15,16 @@ Feature: Append environment variable
15
15
 
16
16
  Scenario: Non-existing variable
17
17
  Given a file named "spec/environment_spec.rb" with:
18
- """
18
+ """ruby
19
19
  require 'spec_helper'
20
20
 
21
21
  RSpec.describe 'Long running command', :type => :aruba do
22
22
  before(:each) { append_environment_variable 'LONG_LONG_VARIABLE', 'a' }
23
+
23
24
  before(:each) { run('env') }
25
+ before(:each) { stop_all_commands }
24
26
 
25
- it { expect(last_command.output).to include 'LONG_LONG_VARIABLE=a' }
27
+ it { expect(last_command_started.output).to include 'LONG_LONG_VARIABLE=a' }
26
28
  end
27
29
  """
28
30
  When I run `rspec`
@@ -30,15 +32,17 @@ Feature: Append environment variable
30
32
 
31
33
  Scenario: Existing inner variable
32
34
  Given a file named "spec/environment_spec.rb" with:
33
- """
35
+ """ruby
34
36
  require 'spec_helper'
35
37
 
36
38
  RSpec.describe 'Long running command', :type => :aruba do
37
39
  before(:each) { append_environment_variable 'LONG_LONG_VARIABLE', 'a' }
38
40
  before(:each) { append_environment_variable 'LONG_LONG_VARIABLE', 'b' }
41
+
39
42
  before(:each) { run('env') }
43
+ before(:each) { stop_all_commands }
40
44
 
41
- it { expect(last_command.output).to include 'LONG_LONG_VARIABLE=ab' }
45
+ it { expect(last_command_started.output).to include 'LONG_LONG_VARIABLE=ab' }
42
46
  end
43
47
  """
44
48
  When I run `rspec`
@@ -47,16 +51,18 @@ Feature: Append environment variable
47
51
 
48
52
  Scenario: Existing outer variable
49
53
  Given a file named "spec/environment_spec.rb" with:
50
- """
54
+ """ruby
51
55
  require 'spec_helper'
52
56
 
53
57
  ENV['REALLY_LONG_LONG_VARIABLE'] = 'a'
54
58
 
55
59
  RSpec.describe 'Long running command', :type => :aruba do
56
60
  before(:each) { append_environment_variable 'REALLY_LONG_LONG_VARIABLE', 'b' }
61
+
57
62
  before(:each) { run('env') }
63
+ before(:each) { stop_all_commands }
58
64
 
59
- it { expect(last_command.output).to include 'REALLY_LONG_LONG_VARIABLE=ab' }
65
+ it { expect(last_command_started.output).to include 'REALLY_LONG_LONG_VARIABLE=ab' }
60
66
 
61
67
  # Has no effect here, is not in block and not a command `run`
62
68
  it { expect(ENV['REALLY_LONG_LONG_VARIABLE']).to eq 'a' }
@@ -67,14 +73,16 @@ Feature: Append environment variable
67
73
 
68
74
  Scenario: Run some ruby code with previously set environment
69
75
  Given a file named "spec/environment_spec.rb" with:
70
- """
76
+ """ruby
71
77
  require 'spec_helper'
72
78
 
73
79
  ENV['REALLY_LONG_LONG_VARIABLE'] = 'a'
74
80
 
75
81
  RSpec.describe 'Long running command', :type => :aruba do
76
82
  before(:each) { append_environment_variable 'REALLY_LONG_LONG_VARIABLE', 'b' }
83
+
77
84
  before(:each) { run('env') }
85
+ before(:each) { stop_all_commands }
78
86
 
79
87
  it do
80
88
  with_environment do
@@ -95,14 +103,16 @@ Feature: Append environment variable
95
103
  overwrites the variable
96
104
 
97
105
  Given a file named "spec/environment_spec.rb" with:
98
- """
106
+ """ruby
99
107
  require 'spec_helper'
100
108
 
101
109
  ENV['REALLY_LONG_LONG_VARIABLE'] = 'a'
102
110
 
103
111
  RSpec.describe 'Long running command', :type => :aruba do
104
112
  before(:each) { append_environment_variable 'REALLY_LONG_LONG_VARIABLE', 'b' }
113
+
105
114
  before(:each) { run('env') }
115
+ before(:each) { stop_all_commands }
106
116
 
107
117
  it do
108
118
  with_environment 'REALLY_LONG_LONG_VARIABLE' => 'a' do
@@ -15,14 +15,16 @@ Feature: Prepend environment variable
15
15
 
16
16
  Scenario: Non-existing variable
17
17
  Given a file named "spec/environment_spec.rb" with:
18
- """
18
+ """ruby
19
19
  require 'spec_helper'
20
20
 
21
21
  RSpec.describe 'Long running command', :type => :aruba do
22
22
  before(:each) { prepend_environment_variable 'LONG_LONG_VARIABLE', 'a' }
23
+
23
24
  before(:each) { run('env') }
25
+ before(:each) { stop_all_commands }
24
26
 
25
- it { expect(last_command.output).to include 'LONG_LONG_VARIABLE=a' }
27
+ it { expect(last_command_started.output).to include 'LONG_LONG_VARIABLE=a' }
26
28
  end
27
29
  """
28
30
  When I run `rspec`
@@ -30,15 +32,17 @@ Feature: Prepend environment variable
30
32
 
31
33
  Scenario: Existing inner variable
32
34
  Given a file named "spec/environment_spec.rb" with:
33
- """
35
+ """ruby
34
36
  require 'spec_helper'
35
37
 
36
38
  RSpec.describe 'Long running command', :type => :aruba do
37
39
  before(:each) { prepend_environment_variable 'LONG_LONG_VARIABLE', 'a' }
38
40
  before(:each) { prepend_environment_variable 'LONG_LONG_VARIABLE', 'b' }
41
+
39
42
  before(:each) { run('env') }
43
+ before(:each) { stop_all_commands }
40
44
 
41
- it { expect(last_command.output).to include 'LONG_LONG_VARIABLE=ba' }
45
+ it { expect(last_command_started.output).to include 'LONG_LONG_VARIABLE=ba' }
42
46
  end
43
47
  """
44
48
  When I run `rspec`
@@ -47,16 +51,18 @@ Feature: Prepend environment variable
47
51
 
48
52
  Scenario: Existing outer variable
49
53
  Given a file named "spec/environment_spec.rb" with:
50
- """
54
+ """ruby
51
55
  require 'spec_helper'
52
56
 
53
57
  ENV['REALLY_LONG_LONG_VARIABLE'] = 'a'
54
58
 
55
59
  RSpec.describe 'Long running command', :type => :aruba do
56
60
  before(:each) { prepend_environment_variable 'REALLY_LONG_LONG_VARIABLE', 'b' }
61
+
57
62
  before(:each) { run('env') }
63
+ before(:each) { stop_all_commands }
58
64
 
59
- it { expect(last_command.output).to include 'REALLY_LONG_LONG_VARIABLE=ba' }
65
+ it { expect(last_command_started.output).to include 'REALLY_LONG_LONG_VARIABLE=ba' }
60
66
 
61
67
  # Has no effect here, is not in block and not a command `run`
62
68
  it { expect(ENV['REALLY_LONG_LONG_VARIABLE']).to eq 'a' }
@@ -67,14 +73,16 @@ Feature: Prepend environment variable
67
73
 
68
74
  Scenario: Run some ruby code with previously set environment
69
75
  Given a file named "spec/environment_spec.rb" with:
70
- """
76
+ """ruby
71
77
  require 'spec_helper'
72
78
 
73
79
  ENV['REALLY_LONG_LONG_VARIABLE'] = 'a'
74
80
 
75
81
  RSpec.describe 'Long running command', :type => :aruba do
76
82
  before(:each) { prepend_environment_variable 'REALLY_LONG_LONG_VARIABLE', 'b' }
83
+
77
84
  before(:each) { run('env') }
85
+ before(:each) { stop_all_commands }
78
86
 
79
87
  it do
80
88
  with_environment do
@@ -95,14 +103,16 @@ Feature: Prepend environment variable
95
103
  overwrites the variable
96
104
 
97
105
  Given a file named "spec/environment_spec.rb" with:
98
- """
106
+ """ruby
99
107
  require 'spec_helper'
100
108
 
101
109
  ENV['REALLY_LONG_LONG_VARIABLE'] = 'a'
102
110
 
103
111
  RSpec.describe 'Long running command', :type => :aruba do
104
112
  before(:each) { prepend_environment_variable 'REALLY_LONG_LONG_VARIABLE', 'b' }
113
+
105
114
  before(:each) { run('env') }
115
+ before(:each) { stop_all_commands }
106
116
 
107
117
  it do
108
118
  with_environment 'REALLY_LONG_LONG_VARIABLE' => 'a' do