-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #309 from dg-ratiodata/feature/move_to_event_queue
Make use of commands easier by introducing an event queue
- Loading branch information
Showing
92 changed files
with
2,302 additions
and
834 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
Feature: Find a started command | ||
|
||
This feature is experimental and may change without further notice. | ||
|
||
Background: | ||
Given I use a fixture named "cli-app" | ||
|
||
Scenario: Exising command | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
before(:each) { run('echo hello') } | ||
let(:command) { find_command('echo hello') } | ||
before(:each) { stop_all_commands } | ||
it { expect(command).to be_successfully_executed } | ||
it { expect(command.commandline).to eq 'echo hello' } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass | ||
|
||
Scenario: Non-Exising command | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
let(:command) { find_command('echo hello') } | ||
it { expect{ command }.to raise_error Aruba::CommandNotFoundError } | ||
it { expect{ command.commandline }.to raise_error Aruba::CommandNotFoundError } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass | ||
|
||
Scenario: Multiple commands | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
before(:each) { run('echo hello1') } | ||
before(:each) { run('echo hello2') } | ||
let(:command) { find_command('echo hello1') } | ||
before(:each) { stop_all_commands } | ||
it { expect(command).to be_successfully_executed } | ||
it { expect(command.commandline).to eq 'echo hello1' } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass | ||
|
||
Scenario: Multiple commands with same commandline | ||
|
||
If searches in reverse. So it finds the last command started with the given commandline. | ||
|
||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
before(:each) { set_environment_variable 'ENV_VAR', '1' } | ||
before(:each) { run('bash -c "echo -n $ENV_VAR"') } | ||
before(:each) { set_environment_variable 'ENV_VAR', '2' } | ||
before(:each) { run('bash -c "echo -n $ENV_VAR"') } | ||
let(:command) { find_command('bash -c "echo -n $ENV_VAR"') } | ||
before(:each) { stop_all_commands } | ||
it { expect(command).to be_successfully_executed } | ||
it { expect(command.stdout).to eq '2' } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Feature: Return last command started | ||
|
||
Background: | ||
Given I use a fixture named "cli-app" | ||
|
||
Scenario: A command has been started | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
before(:each) { run('echo hello') } | ||
before(:each) { stop_all_commands } | ||
it { expect(last_command_started).to be_successfully_executed } | ||
it { expect(last_command_started.commandline).to eq 'echo hello' } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass | ||
|
||
Scenario: Multiple commands have been started | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
before(:each) { run('echo hello') } | ||
before(:each) { run('echo world') } | ||
before(:each) { stop_all_commands } | ||
it { expect(last_command_started).to be_successfully_executed } | ||
it { expect(last_command_started.commandline).to eq 'echo world' } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass | ||
|
||
Scenario: No command has been started | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
it { expect{ last_command_started.commandline }.to raise_error Aruba::NoCommandHasBeenStartedError } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
Feature: Return last command stopped | ||
|
||
Background: | ||
Given I use a fixture named "cli-app" | ||
|
||
Scenario: A command has been started | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
before(:each) { run('echo hello') } | ||
before(:each) { stop_all_commands } | ||
it { expect(last_command_stopped).to be_successfully_executed } | ||
it { expect(last_command_stopped.commandline).to eq 'echo hello' } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass | ||
|
||
Scenario: Multiple commands have been started and all are stopped | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
before(:each) { run('echo hello') } | ||
before(:each) { run('echo world') } | ||
before(:each) { stop_all_commands } | ||
it { expect(last_command_stopped).to be_successfully_executed } | ||
it { expect(last_command_stopped.commandline).to eq 'echo world' } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass | ||
|
||
Scenario: Multiple commands have been started and a single one is stopped | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
before(:each) { run('echo hello') } | ||
before(:each) { find_command('echo hello').stop } | ||
before(:each) { run('echo world') } | ||
it { expect(last_command_stopped).to be_successfully_executed } | ||
it { expect(last_command_stopped.commandline).to eq 'echo hello' } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass | ||
|
||
|
||
@requires-aruba-version-1 | ||
Scenario: No command has been started | ||
Given a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
it { expect{ last_command_stopped.commandline }.to raise_error Aruba::NoCommandHasBeenStoppedError } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass | ||
|
||
@requires-aruba-version-1 | ||
Scenario: No command has been stopped | ||
Given an executable named "bin/cli" with: | ||
"""bash | ||
#!/bin/bash | ||
while [ true ]; do sleep 1; done | ||
""" | ||
And a file named "spec/run_spec.rb" with: | ||
"""ruby | ||
require 'spec_helper' | ||
RSpec.describe 'Run command', :type => :aruba do | ||
before(:each) { run('cli') } | ||
it { expect{ last_command_stopped.commandline }.to raise_error Aruba::NoCommandHasBeenStoppedError } | ||
end | ||
""" | ||
When I run `rspec` | ||
Then the specs should all pass |
Oops, something went wrong.