aruba 0.14.9 → 0.14.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/.travis.yml +17 -37
- data/CHANGELOG.md +30 -0
- data/Gemfile +11 -1
- data/features/{getting_started/cleanup.feature → 01_getting_started_with_aruba/cleanup_working_directory.feature} +4 -5
- data/features/{getting_started → 01_getting_started_with_aruba}/run_commands.feature +45 -15
- data/features/{getting_started → 01_getting_started_with_aruba}/supported_testing_frameworks.feature +5 -21
- data/features/{configuration → 02_configure_aruba}/activate_announcer_on_command_failure.feature +2 -2
- data/features/{configuration/usage.feature → 02_configure_aruba/basics.feature} +21 -29
- data/features/{configuration → 02_configure_aruba}/command_runtime_environment.feature +0 -0
- data/features/{configuration → 02_configure_aruba}/console_history_file.feature +2 -2
- data/features/{configuration → 02_configure_aruba}/exit_timeout.feature +25 -17
- data/features/{configuration → 02_configure_aruba}/fixtures_directories.feature +2 -2
- data/features/{configuration → 02_configure_aruba}/fixtures_path_prefix.feature +1 -1
- data/features/{configuration → 02_configure_aruba}/home_directory.feature +6 -6
- data/features/{configuration → 02_configure_aruba}/io_timeout.feature +2 -2
- data/features/{configuration → 02_configure_aruba}/keep_ansi.feature +0 -0
- data/features/{configuration → 02_configure_aruba}/log_level.feature +2 -2
- data/features/{configuration → 02_configure_aruba}/physical_block_size.feature +3 -3
- data/features/{configuration → 02_configure_aruba}/remove_ansi_escape_sequences.feature +2 -2
- data/features/{configuration → 02_configure_aruba}/root_directory.feature +1 -1
- data/features/{configuration → 02_configure_aruba}/startup_wait_time.feature +2 -2
- data/features/{configuration → 02_configure_aruba}/working_directory.feature +9 -4
- data/features/{steps/core/announce.feature → 03_testing_frameworks/cucumber/announce_information_for_troubleshooting.feature} +20 -40
- data/features/{steps/environment → 03_testing_frameworks/cucumber}/disable_bunder.feature +0 -0
- data/features/{steps/command/exit_statuses.feature → 03_testing_frameworks/cucumber/steps/command/check_for_exit_statuses.feature} +20 -20
- data/features/{steps/command/output.feature → 03_testing_frameworks/cucumber/steps/command/check_output_of_command.feature} +58 -111
- data/features/{steps/command/stderr.feature → 03_testing_frameworks/cucumber/steps/command/check_stderr_of_command.feature} +1 -1
- data/features/{steps/command/stdout.feature → 03_testing_frameworks/cucumber/steps/command/check_stdout_of_command.feature} +6 -6
- data/features/{steps/command/debug.feature → 03_testing_frameworks/cucumber/steps/command/debug_your_command_in_aruba.feature} +6 -6
- data/features/{steps/command/run.feature → 03_testing_frameworks/cucumber/steps/command/run_a_command.feature} +4 -4
- data/features/{steps/command/in_process.feature → 03_testing_frameworks/cucumber/steps/command/run_command_in_process.feature} +2 -2
- data/features/{steps/command/interactive.feature → 03_testing_frameworks/cucumber/steps/command/run_command_interactively.feature} +2 -2
- data/features/03_testing_frameworks/cucumber/steps/command/run_commands_which_require_a_shell.feature +79 -0
- data/features/{steps/command/send_signal.feature → 03_testing_frameworks/cucumber/steps/command/send_signal_to_command.feature} +19 -40
- data/features/{steps/command/stop.feature → 03_testing_frameworks/cucumber/steps/command/stop_command.feature} +47 -75
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/environment/append_environment_variable.feature +3 -3
- data/features/{steps/environment/home_variable.feature → 03_testing_frameworks/cucumber/steps/environment/modify_home_variable_for_testing.feature} +4 -4
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/environment/prepend_environment_variable.feature +3 -3
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/environment/set_environment_variable.feature +3 -3
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/append_to_file.feature +0 -0
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/cd_to_directory.feature +0 -0
- data/features/{steps/filesystem/existence_of_directory.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_existence_of_directory.feature} +0 -0
- data/features/{steps/filesystem/existence_of_file.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_existence_of_file.feature} +0 -0
- data/features/{steps/filesystem/file_content.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_file_content.feature} +57 -0
- data/features/{steps/filesystem/non_existence_of_directory.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_non_existence_of_directory.feature} +0 -0
- data/features/{steps/filesystem/non_existence_of_file.feature → 03_testing_frameworks/cucumber/steps/filesystem/check_non_existence_of_file.feature} +0 -0
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/check_permissions_of_file.feature +0 -0
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/compare_files.feature +0 -0
- data/features/{steps/filesystem/copy.feature → 03_testing_frameworks/cucumber/steps/filesystem/copy_file_or_directory.feature} +0 -0
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/create_directory.feature +0 -0
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/create_file.feature +0 -0
- data/features/{steps/filesystem/move.feature → 03_testing_frameworks/cucumber/steps/filesystem/move_file_or_directory.feature} +0 -1
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/overwrite_file.feature +0 -0
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/remove_directory.feature +0 -0
- data/features/{steps → 03_testing_frameworks/cucumber/steps}/filesystem/remove_file.feature +0 -0
- data/features/{steps/filesystem/use_fixture.feature → 03_testing_frameworks/cucumber/steps/filesystem/use_fixtures_for_setup_test.feature} +0 -0
- data/features/{hooks/after/command.feature → 03_testing_frameworks/rspec/hooks/define_after_hook_for_commands.feature} +1 -4
- data/features/{hooks/before/command.feature → 03_testing_frameworks/rspec/hooks/define_before_hook_for_commands.feature} +1 -5
- data/features/{rspec/integration.feature → 03_testing_frameworks/rspec/setup_aruba_for_rspec.feature} +17 -17
- data/features/{api/command/find_command.feature → 04_aruba_api/command/find_a_started_command.feature} +0 -0
- data/features/{api/command/which.feature → 04_aruba_api/command/find_command_in_PATH.feature} +4 -4
- data/features/{api/command/stderr.feature → 04_aruba_api/command/read_stderr_of_command.feature} +8 -8
- data/features/{api/command/stdout.feature → 04_aruba_api/command/read_stdout_of_command.feature} +7 -7
- data/features/{api/command/run.feature → 04_aruba_api/command/run_command.feature} +53 -44
- data/features/{api → 04_aruba_api}/command/run_simple.feature +46 -34
- data/features/{api/command/send_signal.feature → 04_aruba_api/command/send_signal_to_command.feature} +8 -8
- data/features/{api → 04_aruba_api}/command/stop_all_commands.feature +18 -14
- data/features/{api/command/stop.feature → 04_aruba_api/command/stop_single_command.feature} +19 -18
- data/features/{api → 04_aruba_api}/command/terminate_all_commands.feature +16 -12
- data/features/{api/command/last_command_started.feature → 04_aruba_api/command/use_last_command_started.feature} +0 -0
- data/features/{api/command/last_command_stopped.feature → 04_aruba_api/command/use_last_command_stopped.feature} +2 -2
- data/features/{api → 04_aruba_api}/core/expand_path.feature +0 -0
- data/features/{api → 04_aruba_api}/environment/append_environment_variable.feature +0 -0
- data/features/{api → 04_aruba_api}/environment/delete_environment_variable.feature +0 -0
- data/features/{api → 04_aruba_api}/environment/prepend_environment_variable.feature +0 -0
- data/features/{api → 04_aruba_api}/environment/set_environment_variable.feature +0 -0
- data/features/{api/filesystem/cd.feature → 04_aruba_api/filesystem/cd_to_directory.feature} +0 -0
- data/features/{api/filesystem/does_exist.feature → 04_aruba_api/filesystem/check_existence_file_or_directory.feature} +0 -0
- data/features/{api/filesystem/is_absolute.feature → 04_aruba_api/filesystem/check_if_path_is_absolute.feature} +0 -0
- data/features/{api/filesystem/is_directory.feature → 04_aruba_api/filesystem/check_if_path_is_directory.feature} +0 -0
- data/features/{api/filesystem/is_file.feature → 04_aruba_api/filesystem/check_if_path_is_file.feature} +0 -0
- data/features/{api/filesystem/is_relative.feature → 04_aruba_api/filesystem/check_if_path_is_relative.feature} +0 -0
- data/features/{api → 04_aruba_api}/filesystem/create_directory.feature +0 -0
- data/features/{api/filesystem/move.feature → 04_aruba_api/filesystem/move_file_or_directory.feature} +0 -0
- data/features/{api/filesystem/disk_usage.feature → 04_aruba_api/filesystem/report_disk_usage.feature} +0 -0
- data/features/{api/filesystem/fixtures.feature → 04_aruba_api/filesystem/use_fixtures.feature} +0 -0
- data/features/{api → 04_aruba_api}/text/extract_text.feature +8 -8
- data/features/{api → 04_aruba_api}/text/replace_variables.feature +2 -2
- data/features/{api → 04_aruba_api}/text/sanitize_text.feature +22 -22
- data/features/{api → 04_aruba_api}/text/unescape_text.feature +12 -12
- data/features/{matchers/timeouts.feature → 05_use_rspec_matchers/command/check_timeouts.feature} +4 -4
- data/features/{matchers → 05_use_rspec_matchers}/directory/have_sub_directory.feature +0 -0
- data/features/{matchers → 05_use_rspec_matchers}/file/be_a_command_found_in_path.feature +0 -0
- data/features/{matchers → 05_use_rspec_matchers}/file/be_existing_executable.feature +0 -0
- data/features/{matchers → 05_use_rspec_matchers}/file/be_existing_file.feature +0 -0
- data/features/{matchers → 05_use_rspec_matchers}/file/have_file_content.feature +0 -0
- data/features/{matchers → 05_use_rspec_matchers}/file/have_file_size.feature +0 -0
- data/features/{matchers → 05_use_rspec_matchers}/path/be_an_absolute_path.feature +0 -0
- data/features/{matchers → 05_use_rspec_matchers}/path/be_an_existing_path.feature +0 -0
- data/features/{matchers → 05_use_rspec_matchers}/path/have_permissions.feature +4 -4
- data/features/{cli/init.feature → 06_use_aruba_cli/initialize_project_with_aruba.feature} +0 -0
- data/features/{cli/console.feature → 06_use_aruba_cli/open_console.feature} +0 -0
- data/features/08_other/improve_performance_if_using_jruby.feature +37 -0
- data/features/step_definitions/hooks.rb +0 -10
- data/features/support/env.rb +1 -1
- data/features/support/simplecov_setup.rb +9 -6
- data/fixtures/cli-app/bin/{cli → aruba-test-cli} +0 -0
- data/fixtures/cli-app/spec/spec_helper.rb +1 -0
- data/fixtures/empty-app/lib/cli/app.rb +0 -6
- data/lib/aruba/api/commands.rb +24 -0
- data/lib/aruba/api/core.rb +9 -2
- data/lib/aruba/api/deprecated.rb +2 -73
- data/lib/aruba/api/filesystem.rb +1 -1
- data/lib/aruba/colorizer.rb +10 -99
- data/lib/aruba/config/jruby.rb +15 -5
- data/lib/aruba/cucumber.rb +1 -0
- data/lib/aruba/cucumber/command.rb +63 -93
- data/lib/aruba/cucumber/deprecated.rb +93 -0
- data/lib/aruba/cucumber/file.rb +0 -12
- data/lib/aruba/cucumber/hooks.rb +0 -44
- data/lib/aruba/in_process.rb +2 -0
- data/lib/aruba/matchers/string/output_string_eq.rb +1 -1
- data/lib/aruba/platforms/announcer.rb +1 -1
- data/lib/aruba/platforms/command_monitor.rb +0 -3
- data/lib/aruba/processes/spawn_process.rb +17 -5
- data/lib/aruba/spawn_process.rb +4 -1
- data/lib/aruba/version.rb +1 -1
- data/script/bootstrap +0 -4
- data/spec/aruba/api/core_spec.rb +142 -0
- data/spec/aruba/api/deprecated_spec.rb +113 -0
- data/spec/aruba/api/filesystem_spec.rb +746 -0
- data/spec/aruba/api_spec.rb +1 -885
- data/spec/aruba/jruby_spec.rb +46 -28
- data/spec/aruba/{spawn_process_spec.rb → processes/spawn_process_spec.rb} +18 -2
- data/spec/spec_helper.rb +5 -3
- metadata +108 -115
- data/features/development/build.feature +0 -15
- data/features/getting_started/writing_good_feature_tests.feature +0 -38
- data/features/matchers/collection/include_an_object.feature +0 -72
- data/features/platforms/jruby.feature +0 -14
- data/features/step_definitions/aruba_dev_steps.rb +0 -56
- data/features/steps/command/shell.feature +0 -155
- data/features/steps/filesystem/check_file_content.feature +0 -61
- data/features/steps/filesystem/fixtures.feature +0 -64
- data/features/steps/overview.feature +0 -25
- data/spec/aruba/api/environment/restore_env_spec.rb +0 -86
- data/spec/aruba/api/environment/set_env_spec.rb +0 -46
- data/spec/aruba/api/filesystem/file_size_spec.rb +0 -28
@@ -1,86 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.describe 'Command Environment' do
|
4
|
-
include_context 'uses aruba API'
|
5
|
-
|
6
|
-
around do |example|
|
7
|
-
Aruba.platform.with_environment do
|
8
|
-
example.run
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
before do
|
13
|
-
allow(Aruba.platform).to receive(:deprecated)
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '#restore_env' do
|
17
|
-
context 'when non-existing variable' do
|
18
|
-
before :each do
|
19
|
-
ENV.delete 'LONG_LONG_ENV_VARIABLE'
|
20
|
-
end
|
21
|
-
|
22
|
-
context 'when set single' do
|
23
|
-
before :each do
|
24
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '1'
|
25
|
-
@aruba.restore_env
|
26
|
-
end
|
27
|
-
|
28
|
-
it { expect(ENV).not_to be_key 'LONG_LONG_ENV_VARIABLE' }
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'when set multiple times' do
|
32
|
-
before :each do
|
33
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '1'
|
34
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '2'
|
35
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '3'
|
36
|
-
@aruba.restore_env
|
37
|
-
end
|
38
|
-
|
39
|
-
it { expect(ENV).not_to be_key 'LONG_LONG_ENV_VARIABLE' }
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
context 'when existing variable from outer context' do
|
44
|
-
before :each do
|
45
|
-
ENV['LONG_LONG_ENV_VARIABLE'] = '0'
|
46
|
-
end
|
47
|
-
|
48
|
-
context 'when set single time' do
|
49
|
-
before :each do
|
50
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '1'
|
51
|
-
@aruba.restore_env
|
52
|
-
end
|
53
|
-
|
54
|
-
it { expect(ENV['LONG_LONG_ENV_VARIABLE']).to eq '0' }
|
55
|
-
end
|
56
|
-
|
57
|
-
context 'when set multiple times' do
|
58
|
-
before :each do
|
59
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '1'
|
60
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '2'
|
61
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '3'
|
62
|
-
@aruba.restore_env
|
63
|
-
end
|
64
|
-
|
65
|
-
it { expect(ENV['LONG_LONG_ENV_VARIABLE']).to eq '0' }
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
describe "#restore_env" do
|
71
|
-
after(:each) { @aruba.all_commands.each(&:stop) }
|
72
|
-
it "restores environment variable" do
|
73
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', 'true'
|
74
|
-
@aruba.restore_env
|
75
|
-
@aruba.run "env"
|
76
|
-
expect(@aruba.all_output).not_to include("LONG_LONG_ENV_VARIABLE")
|
77
|
-
end
|
78
|
-
it "restores environment variable that has been set multiple times" do
|
79
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', 'true'
|
80
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', 'false'
|
81
|
-
@aruba.restore_env
|
82
|
-
@aruba.run "env"
|
83
|
-
expect(@aruba.all_output).not_to include("LONG_LONG_ENV_VARIABLE")
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.describe 'Command Environment' do
|
4
|
-
include_context 'uses aruba API'
|
5
|
-
|
6
|
-
around do |example|
|
7
|
-
Aruba.platform.with_environment do
|
8
|
-
example.run
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
before do
|
13
|
-
allow(Aruba.platform).to receive(:deprecated)
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '#set_env' do
|
17
|
-
context 'when non-existing variable' do
|
18
|
-
before :each do
|
19
|
-
ENV.delete('LONG_LONG_ENV_VARIABLE')
|
20
|
-
end
|
21
|
-
|
22
|
-
context 'when string' do
|
23
|
-
before :each do
|
24
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '1'
|
25
|
-
end
|
26
|
-
|
27
|
-
it { expect(ENV['LONG_LONG_ENV_VARIABLE']).to eq '1' }
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'when existing variable set by aruba' do
|
32
|
-
before :each do
|
33
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '1'
|
34
|
-
@aruba.set_env 'LONG_LONG_ENV_VARIABLE', '2'
|
35
|
-
end
|
36
|
-
|
37
|
-
it { expect(ENV['LONG_LONG_ENV_VARIABLE']).to eq '2' }
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'when existing variable by outer context' do
|
41
|
-
before :each do
|
42
|
-
ENV['LONG_LONG_ENV_VARIABLE'] = '1'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.describe 'Filesystem Api' do
|
4
|
-
include_context 'uses aruba API'
|
5
|
-
|
6
|
-
def expand_path(*args)
|
7
|
-
@aruba.expand_path(*args)
|
8
|
-
end
|
9
|
-
|
10
|
-
describe '#file_size' do
|
11
|
-
let(:name) { @file_name }
|
12
|
-
let(:path) { @file_path }
|
13
|
-
let(:size) { file_size(name) }
|
14
|
-
|
15
|
-
context 'when file exist' do
|
16
|
-
before :each do
|
17
|
-
File.open(path, 'w') { |f| f.print 'a' }
|
18
|
-
end
|
19
|
-
|
20
|
-
it { expect(size).to eq 1 }
|
21
|
-
end
|
22
|
-
|
23
|
-
context 'when file does not exist' do
|
24
|
-
let(:name) { 'non_existing_file' }
|
25
|
-
it { expect { size }.to raise_error RSpec::Expectations::ExpectationNotMetError }
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|