1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 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_command('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_command('echo hello') }
before(:each) { run_command('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
|