Module: Aruba::Api::Deprecated
- Included in:
- Aruba::Api
- Defined in:
- lib/aruba/api/deprecated.rb
Overview
Deprecated
Instance Method Summary collapse
- #_create_file(name, content, check_presence) ⇒ Object deprecated Deprecated.
- #_create_fixed_size_file(file_name, file_size, check_presence) ⇒ Object deprecated Deprecated.
- #_ensure_newline(str) ⇒ Object deprecated Deprecated.
- #_mkdir(dir_name) ⇒ Object deprecated Deprecated.
- #_read_interactive ⇒ Object deprecated Deprecated.
- #_rm(dir_name) ⇒ Object deprecated Deprecated.
- #_write_interactive(input) ⇒ Object deprecated Deprecated.
- #absolute_path(*args) ⇒ Object deprecated Deprecated.
- #all_output ⇒ String deprecated Deprecated.
- #all_stderr ⇒ String deprecated Deprecated.
- #all_stdout ⇒ String deprecated Deprecated.
- #announce_or_puts(msg) ⇒ Object deprecated Deprecated.
- #announcer ⇒ Object deprecated Deprecated.
- #append_output_to(message) ⇒ Object deprecated Deprecated.
- #assert_exact_output(expected, actual) ⇒ TrueClass, FalseClass deprecated Deprecated.
- #assert_exit_status(status) ⇒ Object deprecated Deprecated.
- #assert_exit_status_and_output(expect_to_pass, expected_output, expect_exact_output) ⇒ Object deprecated Deprecated.
- #assert_exit_status_and_partial_output(expect_to_pass, expected) ⇒ Object deprecated Deprecated.
- #assert_failing_with(expected) ⇒ TrueClass, FalseClass deprecated Deprecated.
- #assert_matching_output(expected, actual) ⇒ TrueClass, FalseClass deprecated Deprecated.
- #assert_no_partial_output(unexpected, actual) ⇒ TrueClass, FalseClass deprecated Deprecated.
- #assert_not_exit_status(status) ⇒ Object deprecated Deprecated.
- #assert_not_matching_output(expected, actual) ⇒ TrueClass, FalseClass deprecated Deprecated.
- #assert_partial_output(expected, actual) ⇒ TrueClass, FalseClass deprecated Deprecated.
- #assert_partial_output_interactive(expected) ⇒ TrueClass, FalseClass deprecated Deprecated.
- #assert_passing_with(expected) ⇒ TrueClass, FalseClass deprecated Deprecated.
- #assert_success(success) ⇒ TrueClass, FalseClass deprecated Deprecated.
- #check_binary_file_content(file, reference_file, expect_match = true) ⇒ Object deprecated Deprecated.
- #check_directory_presence(paths, expect_presence) ⇒ Object deprecated Deprecated.
- #check_exact_file_content(file, exact_content, expect_match = true) ⇒ Object deprecated Deprecated.
-
#check_file_content(file, content, expect_match = true) ⇒ Object
Check the content of file.
- #check_file_presence(paths, expect_presence = true) ⇒ Object deprecated Deprecated.
- #check_file_size(paths_and_sizes) ⇒ Object deprecated Deprecated.
-
#check_filesystem_permissions(*args) ⇒ Object
Check file system permissions of file.
- #check_for_deprecated_variables ⇒ Object deprecated Deprecated.
- #clean_current_dir(*args, &block) ⇒ Object deprecated Deprecated.
- #clean_current_directory ⇒ Object deprecated Deprecated.
- #create_dir(*args) ⇒ Object deprecated Deprecated.
- #current_dir(*args, &block) ⇒ Object deprecated Deprecated.
- #current_directory ⇒ Object deprecated Deprecated.
- #current_ruby ⇒ Object deprecated Deprecated.
- #detect_ruby(cmd) ⇒ Object deprecated Deprecated.
- #dirs ⇒ Array deprecated Deprecated.
- #eot ⇒ Object deprecated Deprecated.
- #exit_timeout ⇒ Object deprecated Deprecated.
- #filesystem_permissions(*args) ⇒ Object deprecated Deprecated.
-
#fixtures_directory ⇒ String
The path to the directory which contains fixtures You might want to overwrite this method to place your data else where.
- #get_process(wanted) ⇒ Object deprecated Deprecated.
- #in_current_dir(&block) ⇒ Object deprecated Deprecated.
- #in_current_directory { ... } ⇒ Object deprecated Deprecated.
- #io_wait ⇒ Object deprecated Deprecated.
-
#last_command ⇒ Object
Last command started.
- #last_exit_status ⇒ Object deprecated Deprecated.
- #mod?(file, perms, &block) ⇒ Boolean deprecated Deprecated.
- #only_processes ⇒ Object deprecated Deprecated.
- #original_env ⇒ Object deprecated Deprecated.
- #output_from(cmd) ⇒ Object deprecated Deprecated.
- #prep_for_fs_check(&block) ⇒ Object deprecated Deprecated.
- #process_monitor ⇒ Object deprecated Deprecated.
- #processes ⇒ Object deprecated Deprecated.
- #register_process(*args) ⇒ Object deprecated Deprecated.
- #remove_dir(*args) ⇒ Object deprecated Deprecated.
- #remove_directory(*args) ⇒ Object deprecated Deprecated.
- #remove_file(*args) ⇒ Object deprecated Deprecated.
- #restore_env ⇒ Object deprecated Deprecated.
- #root_directory ⇒ Object deprecated Deprecated.
-
#run_interactive(cmd) ⇒ Object
Run a command interactively.
- #set_env(key, value) ⇒ Object deprecated Deprecated.
- #stderr_from(cmd) ⇒ Object deprecated Deprecated.
- #stdout_from(cmd) ⇒ Object deprecated Deprecated.
- #stop_process(process) ⇒ Object deprecated Deprecated.
- #stop_processes! ⇒ Object deprecated Deprecated.
- #terminate_process(process) ⇒ Object deprecated Deprecated.
- #terminate_processes! ⇒ Object deprecated Deprecated.
- #touch_file(*args) ⇒ Object deprecated Deprecated.
- #unescape(string, keep_ansi = false) ⇒ Object deprecated Deprecated.
- #with_env(env = {}) { ... } ⇒ Object deprecated Deprecated.
Instance Method Details
#_create_file(name, content, check_presence) ⇒ Object
472 473 474 475 476 477 478 |
# File 'lib/aruba/api/deprecated.rb', line 472 def _create_file(name, content, check_presence) Aruba.platform.deprecated('The use of "#_create_file" is deprecated. It will be removed soon') ArubaFileCreator.new.write((name), content, check_presence) self end |
#_create_fixed_size_file(file_name, file_size, check_presence) ⇒ Object
481 482 483 484 485 486 487 |
# File 'lib/aruba/api/deprecated.rb', line 481 def _create_fixed_size_file(file_name, file_size, check_presence) Aruba.platform.deprecated('The use of "#_create_fixed_size_file" is deprecated. It will be removed soon') ArubaFixedSizeFileCreator.new.write((name), size, check_presence) self end |
#_ensure_newline(str) ⇒ Object
68 69 70 71 72 |
# File 'lib/aruba/api/deprecated.rb', line 68 def _ensure_newline(str) Aruba.platform.deprecated('The use of "#_ensure_newline" is deprecated') Aruba.platform.ensure_newline cmd end |
#_mkdir(dir_name) ⇒ Object
342 343 344 345 346 |
# File 'lib/aruba/api/deprecated.rb', line 342 def _mkdir(dir_name) Aruba.platform.deprecated('The use of "#_mkdir" is deprecated') Aruba.platform.mkdir(dir_name) end |
#_read_interactive ⇒ Object
82 83 84 85 86 |
# File 'lib/aruba/api/deprecated.rb', line 82 def _read_interactive Aruba.platform.deprecated('The use of "#_read_interactive" is deprecated. Please use "last_command_started.stdout" instead') last_command_started.stdout end |
#_rm(dir_name) ⇒ Object
349 350 351 352 353 |
# File 'lib/aruba/api/deprecated.rb', line 349 def _rm(dir_name) Aruba.platform.deprecated('The use of "#_rm_rf" is deprecated') Aruba.platform.rm(dir_name) end |
#_write_interactive(input) ⇒ Object
100 101 102 103 104 |
# File 'lib/aruba/api/deprecated.rb', line 100 def _write_interactive(input) Aruba.platform.deprecated('The use of "#_write_interactive" is deprecated. Please use "#last_command_started.write()" instead') last_command_started.write(input) end |
#absolute_path(*args) ⇒ Object
75 76 77 78 79 |
# File 'lib/aruba/api/deprecated.rb', line 75 def absolute_path(*args) Aruba.platform.deprecated('The use of "absolute_path" is deprecated. Use "expand_path" instead. But be aware that "expand_path" uses a different implementation') File. File.join(*args), aruba.current_directory end |
#all_output ⇒ String
Get stderr and stdout of all processes
787 788 789 790 791 |
# File 'lib/aruba/api/deprecated.rb', line 787 def all_output Aruba.platform.deprecated('The use of "#all_output" is deprecated. Use `all_commands.map { |c| c.output }.join("\n") instead. If you need to check for some output use "expect(all_commands).to have_output /output/" instead') process_monitor.all_output end |
#all_stderr ⇒ String
Get stderr of all processes
775 776 777 778 779 |
# File 'lib/aruba/api/deprecated.rb', line 775 def all_stderr Aruba.platform.deprecated('The use of "#all_stderr" is deprecated. Use `all_commands.map { |c| c.stderr }.join("\n") instead. If you need to check for some output use "expect(all_commands).to have_output_on_stderr /output/" instead') process_monitor.all_stderr end |
#all_stdout ⇒ String
Get stdout of all processes
763 764 765 766 767 |
# File 'lib/aruba/api/deprecated.rb', line 763 def all_stdout Aruba.platform.deprecated('The use of "#all_stdout" is deprecated. Use `all_commands.map { |c| c.stdout }.join("\n") instead. If you need to check for some output use "expect(all_commands).to have_output_on_stdout /output/" instead') process_monitor.all_stdout end |
#announce_or_puts(msg) ⇒ Object
89 90 91 92 93 94 95 96 97 |
# File 'lib/aruba/api/deprecated.rb', line 89 def announce_or_puts(msg) Aruba.platform.deprecated('The use of "#announce_or_puts" is deprecated. Please use "#announcer.mode = :kernel" or "#announcer.mode = :puts" instead') if(@puts) Kernel.puts(msg) else puts(msg) end end |
#announcer ⇒ Object
Access to announcer
865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
# File 'lib/aruba/api/deprecated.rb', line 865 def announcer Aruba.platform.deprecated('The use of "#announcer" is deprecated. Use "aruba.announcer" instead') @announcer ||= Platforms::Announcer.new( self, :stdout => defined?(@announce_stdout), :stderr => defined?(@announce_stderr), :dir => defined?(@announce_dir), :cmd => defined?(@announce_cmd), :env => defined?(@announce_env) ) @announcer end |
#append_output_to(message) ⇒ Object
701 702 703 704 705 |
# File 'lib/aruba/api/deprecated.rb', line 701 def append_output_to() Aruba.platform.deprecated('The use of "#append_output_to" is deprecated') "#{} Output:\n\n#{all_output}\n" end |
#assert_exact_output(expected, actual) ⇒ TrueClass, FalseClass
Full compare arg1 and arg2
567 568 569 570 571 572 |
# File 'lib/aruba/api/deprecated.rb', line 567 def assert_exact_output(expected, actual) Aruba.platform.deprecated('The use of "#assert_exact_output" is deprecated. Use "expect(command).to have_output \'exact\'" instead. There are also special matchers for "stdout" and "stderr"') actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9" expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).to eq Aruba.platform.unescape(expected, aruba.config.keep_ansi) end |
#assert_exit_status(status) ⇒ Object
686 687 688 689 690 |
# File 'lib/aruba/api/deprecated.rb', line 686 def assert_exit_status(status) Aruba.platform.deprecated('The use of "#assert_success" is deprecated. Use "expect(last_command_started).to have_exit_status(status)"') expect(last_command_started).to have_exit_status(status) end |
#assert_exit_status_and_output(expect_to_pass, expected_output, expect_exact_output) ⇒ Object
TODO: Remove this. Call more methods elsewhere instead. Reveals more intent.
305 306 307 308 309 310 311 312 |
# File 'lib/aruba/api/deprecated.rb', line 305 def assert_exit_status_and_output(expect_to_pass, expected_output, expect_exact_output) assert_success(expect_to_pass) if expect_exact_output assert_exact_output(expected_output, all_output) else assert_partial_output(expected_output, all_output) end end |
#assert_exit_status_and_partial_output(expect_to_pass, expected) ⇒ Object
296 297 298 299 300 301 |
# File 'lib/aruba/api/deprecated.rb', line 296 def assert_exit_status_and_partial_output(expect_to_pass, expected) Aruba.platform.deprecated('The use of "assert_exit_status_and_partial_output" is deprecated. Use "#assert_access" and "#assert_partial_output" instead') assert_success(expect_to_pass) assert_partial_output(expected, all_output) end |
#assert_failing_with(expected) ⇒ TrueClass, FalseClass
Check if command failed and if arg1 is included in output
661 662 663 664 665 666 |
# File 'lib/aruba/api/deprecated.rb', line 661 def assert_failing_with(expected) Aruba.platform.deprecated('The use of "#assert_passing_with" is deprecated. Use "expect(all_commands).not_to include_an_object(be_successfully_executed).and include_an_object(have_output(/partial/))" or something similar instead. There are also special matchers for "stdout" and "stderr"') assert_success(false) assert_partial_output(expected, all_output) end |
#assert_matching_output(expected, actual) ⇒ TrueClass, FalseClass
Regex Compare arg1 and arg2
593 594 595 596 597 598 |
# File 'lib/aruba/api/deprecated.rb', line 593 def assert_matching_output(expected, actual) Aruba.platform.deprecated('The use of "#assert_matching_output" is deprecated. Use "expect(command).to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"') actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9" expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).to match(/#{Aruba.platform.unescape(expected, aruba.config.keep_ansi)}/m) end |
#assert_no_partial_output(unexpected, actual) ⇒ TrueClass, FalseClass
Negative partial compare arg1 and arg2
619 620 621 622 623 624 625 626 627 628 |
# File 'lib/aruba/api/deprecated.rb', line 619 def assert_no_partial_output(unexpected, actual) Aruba.platform.deprecated('The use of "#assert_no_partial_output" is deprecated. Use "expect(command).not_to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"') actual.force_encoding(unexpected.encoding) if RUBY_VERSION >= "1.9" if Regexp === unexpected expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).not_to match unexpected else expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).not_to include(unexpected) end end |
#assert_not_exit_status(status) ⇒ Object
693 694 695 696 697 698 |
# File 'lib/aruba/api/deprecated.rb', line 693 def assert_not_exit_status(status) Aruba.platform.deprecated('The use of "#assert_success" is deprecated. Use "expect(last_command_started).not_to have_exit_status(status)"') expect(last_exit_status).not_to eq(status), append_output_to("Exit status was #{last_exit_status} which was not expected.") end |
#assert_not_matching_output(expected, actual) ⇒ TrueClass, FalseClass
Negative regex compare arg1 and arg2
606 607 608 609 610 611 |
# File 'lib/aruba/api/deprecated.rb', line 606 def assert_not_matching_output(expected, actual) Aruba.platform.deprecated('The use of "#assert_not_matching_output" is deprecated. Use "expect(command).not_to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"') actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9" expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).not_to match(/#{Aruba.platform.unescape(expected, aruba.config.keep_ansi)}/m) end |
#assert_partial_output(expected, actual) ⇒ TrueClass, FalseClass
Partial compare arg1 and arg2
580 581 582 583 584 585 |
# File 'lib/aruba/api/deprecated.rb', line 580 def assert_partial_output(expected, actual) Aruba.platform.deprecated('The use of "#assert_partial_output" is deprecated. Use "expect(command).to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"') actual.force_encoding(expected.encoding) if RUBY_VERSION >= "1.9" expect(Aruba.platform.unescape(actual, aruba.config.keep_ansi)).to include(Aruba.platform.unescape(expected, aruba.config.keep_ansi)) end |
#assert_partial_output_interactive(expected) ⇒ TrueClass, FalseClass
Partial compare output of interactive command and arg1
636 637 638 639 640 |
# File 'lib/aruba/api/deprecated.rb', line 636 def assert_partial_output_interactive(expected) Aruba.platform.deprecated('The use of "#assert_partial_output_interactive" is deprecated. Use "expect(last_command_started).to have_output /partial/" instead. There are also special matchers for "stdout" and "stderr"') Aruba.platform.unescape(last_command_started.stdout, aruba.config.keep_ansi).include?(Aruba.platform.unescape(expected, aruba.config.keep_ansi)) ? true : false end |
#assert_passing_with(expected) ⇒ TrueClass, FalseClass
Check if command succeeded and if arg1 is included in output
648 649 650 651 652 653 |
# File 'lib/aruba/api/deprecated.rb', line 648 def assert_passing_with(expected) Aruba.platform.deprecated('The use of "#assert_passing_with" is deprecated. Use "expect(all_commands).to all(be_successfully_executed).and include_an_object(have_output(/partial/))" or something similar instead. There are also special matchers for "stdout" and "stderr"') assert_success(true) assert_partial_output(expected, all_output) end |
#assert_success(success) ⇒ TrueClass, FalseClass
Check exit status of process
675 676 677 678 679 680 681 682 683 |
# File 'lib/aruba/api/deprecated.rb', line 675 def assert_success(success) Aruba.platform.deprecated('The use of "#assert_success" is deprecated. Use "expect(last_command_started).to be_successfully_executed" or with "not_to" or the negative form "have_failed_running" (requires rspec >= 3.1)') if success expect(last_command_started).to be_successfully_executed else expect(last_command_started).not_to be_successfully_executed end end |
#check_binary_file_content(file, reference_file, expect_match = true) ⇒ Object
Check if the content of file against the content of a reference file
250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/aruba/api/deprecated.rb', line 250 def check_binary_file_content(file, reference_file, expect_match = true) Aruba.platform.deprecated('The use of "#check_binary_file_content" is deprecated. Use "expect(file).to have_same_file_content_like(file)"') stop_all_commands if expect_match expect(file).to have_same_file_content_like reference_file else expect(file).not_to have_same_file_content_like reference_file end end |
#check_directory_presence(paths, expect_presence) ⇒ Object
Check presence of a directory
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/aruba/api/deprecated.rb', line 270 def check_directory_presence(paths, expect_presence) Aruba.platform.deprecated('The use of "#check_directory_presence" is deprecated. Use "expect(directory).to be_an_existing_directory"') stop_all_commands paths.each do |path| path = (path) if expect_presence expect(path).to be_an_existing_directory else expect(path).not_to be_an_existing_directory end end end |
#check_exact_file_content(file, exact_content, expect_match = true) ⇒ Object
233 234 235 236 237 |
# File 'lib/aruba/api/deprecated.rb', line 233 def check_exact_file_content(file, exact_content, expect_match = true) Aruba.platform.deprecated('The use of "#check_exact_file_content" is deprecated. Use "expect(file).to have_file_content(content)" with a string') check_file_content(file, exact_content, expect_match) end |
#check_file_content(file, content, expect_match = true) ⇒ Object
Check the content of file
It supports partial content as well. And it is up to you to decided if the content must be there or not.
329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/aruba/api/deprecated.rb', line 329 def check_file_content(file, content, expect_match = true) Aruba.platform.deprecated('The use of "#check_file_content" is deprecated. Use "expect(file).to have_file_content(content)" instead. For eq match use string, for partial match use /regex/') stop_all_commands if expect_match expect(file).to have_file_content content else expect(file).not_to have_file_content content end end |
#check_file_presence(paths, expect_presence = true) ⇒ Object
Check if paths are present
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/aruba/api/deprecated.rb', line 186 def check_file_presence(paths, expect_presence = true) Aruba.platform.deprecated('The use of "check_file_presence" is deprecated. Use "expect().to be_an_existing_file" or "expect(all_paths).to all match /pattern/" instead') stop_all_commands Array(paths).each do |path| if path.kind_of? Regexp if expect_presence expect(all_paths).to match_path_pattern(path) else expect(all_paths).not_to match_path_pattern(path) end else if expect_presence expect(path).to be_an_existing_file else expect(path).not_to be_an_existing_file end end end end |
#check_file_size(paths_and_sizes) ⇒ Object
Check the file size of paths
222 223 224 225 226 227 228 229 230 |
# File 'lib/aruba/api/deprecated.rb', line 222 def check_file_size(paths_and_sizes) Aruba.platform.deprecated('The use of "#check_file_size" is deprecated. Use "expect(file).to have_file_size(size)", "expect(all_files).to all have_file_size(1)", "expect(all_files).to include a_file_with_size(1)" instead') stop_all_commands paths_and_sizes.each do |path, size| expect(path).to have_file_size size end end |
#check_filesystem_permissions(*args) ⇒ Object
Check file system permissions of file
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'lib/aruba/api/deprecated.rb', line 452 def (*args) Aruba.platform.deprecated('The use of "#check_filesystem_permissions" is deprecated. Please use "expect().to have_permissions perms" instead') args = args.flatten = args.shift expected_result = args.pop args.each do |p| raise "Expected #{p} to be present" unless exist? p if expected_result expect(p).to else expect(p).not_to end end end |
#check_for_deprecated_variables ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/MethodLength
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 |
# File 'lib/aruba/api/deprecated.rb', line 528 def check_for_deprecated_variables if defined? @aruba_exit_timeout Aruba.platform.deprecated('The use of "@aruba_exit_timeout" is deprecated. Use "#aruba.config.exit_timeout = <numeric>" instead') aruba.config.exit_timeout = @aruba_exit_timeout end if defined? @aruba_io_wait_seconds Aruba.platform.deprecated('The use of "@aruba_io_wait_seconds" is deprecated. Use "#aruba.config.io_wait_timeout = <numeric>" instead') aruba.config.io_wait_timeout = @aruba_io_wait_seconds end if defined? @keep_ansi Aruba.platform.deprecated('The use of "@aruba_keep_ansi" is deprecated. Use "#aruba.config.remove_ansi_escape_sequences = <true|false>" instead. Be aware that it uses an inverted logic') aruba.config.remove_ansi_escape_sequences = false end if defined? @aruba_root_directory Aruba.platform.deprecated('The use of "@aruba_root_directory" is deprecated. Use "#aruba.config.root_directory = <string>" instead') aruba.config.root_directory = @aruba_root_directory.to_s end end |
#clean_current_dir(*args, &block) ⇒ Object
363 364 365 366 367 |
# File 'lib/aruba/api/deprecated.rb', line 363 def clean_current_dir(*args, &block) Aruba.platform.deprecated('The use of "clean_current_dir" is deprecated. Either use "#setup_aruba" or `#remove(\'.\') to clean up aruba\'s working directory before your tests are run') setup_aruba end |
#clean_current_directory ⇒ Object
Clean the current directory
35 36 37 38 39 |
# File 'lib/aruba/api/deprecated.rb', line 35 def clean_current_directory Aruba.platform.deprecated('The use of "clean_current_directory" is deprecated. Either use "#setup_aruba" or `#remove(\'.\') to clean up aruba\'s working directory before your tests are run') setup_aruba end |
#create_dir(*args) ⇒ Object
156 157 158 159 |
# File 'lib/aruba/api/deprecated.rb', line 156 def create_dir(*args) Aruba.platform.deprecated('The use of "#create_dir" is deprecated. Use "#create_directory" instead') create_directory(*args) end |
#current_dir(*args, &block) ⇒ Object
356 357 358 359 360 |
# File 'lib/aruba/api/deprecated.rb', line 356 def current_dir(*args, &block) Aruba.platform.deprecated('The use of "#current_dir" is deprecated. Use "#current_directory" instead') current_directory(*args, &block) end |
#current_directory ⇒ Object
Get access to current dir
27 28 29 30 31 |
# File 'lib/aruba/api/deprecated.rb', line 27 def current_directory Aruba.platform.deprecated(%(The use of "current_directory" deprecated. Use "expand_path(".")" to get the current directory or "#cd" to run code in the current directory. #{caller.first})) aruba.current_directory.to_s end |
#current_ruby ⇒ Object
61 62 63 64 65 |
# File 'lib/aruba/api/deprecated.rb', line 61 def current_ruby Aruba.platform.deprecated('The use of "#current_ruby" is deprecated') Aruba.platform.current_ruby cmd end |
#detect_ruby(cmd) ⇒ Object
54 55 56 57 58 |
# File 'lib/aruba/api/deprecated.rb', line 54 def detect_ruby(cmd) Aruba.platform.deprecated('The use of "#detect_ruby" is deprecated') Aruba.platform.detect_ruby cmd end |
#dirs ⇒ Array
The path to the directory which should contain all your test data You might want to overwrite this method to place your data else where.
15 16 17 18 19 20 |
# File 'lib/aruba/api/deprecated.rb', line 15 def dirs Aruba.platform.deprecated('The use of "@dirs" is deprecated. Use "Aruba.configure { |c| c.current_directory = \'path/to/dir\' }" instead to set the "current_directory') if defined? @dirs Aruba.platform.deprecated('The use of "dirs" deprecated. Use "Aruba.configure { |c| c.current_directory = \'path/to/dir\' }" instead to set the "current_directory and "expand_path(".")" to get the current directory or use "#cd(\'.\') { # your code }" to run code in the current directory') @dirs ||= aruba.current_directory end |
#eot ⇒ Object
107 108 109 110 111 |
# File 'lib/aruba/api/deprecated.rb', line 107 def eot Aruba.platform.deprecated(%{\e[35m The \"#eot\"-method is deprecated. It will be deleted with the next major version. Please use \"#close_input\"-method instead.\e[0m}) close_input end |
#exit_timeout ⇒ Object
Default exit timeout for running commands with aruba
Overwrite this method if you want a different timeout or set
@aruba_timeout_seconds
.
799 800 801 802 803 |
# File 'lib/aruba/api/deprecated.rb', line 799 def exit_timeout Aruba.platform.deprecated('The use of "#exit_timeout" is deprecated. Use "aruba.config.exit_timeout" instead.') aruba.config.exit_timeout end |
#filesystem_permissions(*args) ⇒ Object
438 439 440 441 442 |
# File 'lib/aruba/api/deprecated.rb', line 438 def (*args) Aruba.platform.deprecated('The use of "#filesystem_permissions" is deprecated. Please use "#chmod" instead') chmod(*args) end |
#fixtures_directory ⇒ String
The path to the directory which contains fixtures You might want to overwrite this method to place your data else where.
519 520 521 522 523 |
# File 'lib/aruba/api/deprecated.rb', line 519 def fixtures_directory Aruba.platform.deprecated('The use of "#fixtures_directory" is deprecated. Use "aruba.fixtures_directory" instead') aruba.fixtures_directory end |
#get_process(wanted) ⇒ Object
715 716 717 718 719 |
# File 'lib/aruba/api/deprecated.rb', line 715 def get_process(wanted) # Aruba.platform.deprecated('The use of "#get_process" is deprecated') process_monitor.get_process(wanted) end |
#in_current_dir(&block) ⇒ Object
370 371 372 373 374 375 |
# File 'lib/aruba/api/deprecated.rb', line 370 def in_current_dir(&block) Aruba.platform.deprecated('The use of "in_current_dir" is deprecated. Use "#cd(\'.\') { }" instead') create_directory '.' unless directory?('.') cd('.', &block) end |
#in_current_directory { ... } ⇒ Object
Execute block in current directory
46 47 48 49 50 51 |
# File 'lib/aruba/api/deprecated.rb', line 46 def in_current_directory(&block) Aruba.platform.deprecated('The use of "in_current_directory" deprecated. Use "#cd(\'.\') { # your code }" instead. But be aware, `cd` requires a previously created directory') create_directory '.' unless directory?('.') cd('.', &block) end |
#io_wait ⇒ Object
Default io wait timeout
Overwrite this method if you want a different timeout or set `@aruba_io_wait_seconds
811 812 813 814 815 |
# File 'lib/aruba/api/deprecated.rb', line 811 def io_wait Aruba.platform.deprecated('The use of "#io_wait" is deprecated. Use "aruba.config.io_wait_timeout" instead') aruba.config.io_wait_timeout end |
#last_command ⇒ Object
Last command started
555 556 557 558 559 |
# File 'lib/aruba/api/deprecated.rb', line 555 def last_command Aruba.platform.deprecated('The use of "#last_command" is deprecated. Use "#last_command_started"') process_monitor.last_command_started end |
#last_exit_status ⇒ Object
826 827 828 829 830 |
# File 'lib/aruba/api/deprecated.rb', line 826 def last_exit_status Aruba.platform.deprecated('The use of "#last_exit_status" is deprecated. Use "#last_command_(started|stopped).exit_status" instead') process_monitor.last_exit_status end |
#mod?(file, perms, &block) ⇒ Boolean
138 139 140 141 142 |
# File 'lib/aruba/api/deprecated.rb', line 138 def mod?(file, perms, &block) Aruba.platform.deprecated('The use of "#mod?" is deprecated. Use "expect().to have_permissions()" instead') expect(Array(file)).to Aruba::Matchers.all (perms) end |
#only_processes ⇒ Object
Only processes
819 820 821 822 823 |
# File 'lib/aruba/api/deprecated.rb', line 819 def only_processes Aruba.platform.deprecated('The use of "#only_processes" is deprecated. Use "#all_commands" instead') process_monitor.only_processes end |
#original_env ⇒ Object
431 432 433 434 435 |
# File 'lib/aruba/api/deprecated.rb', line 431 def original_env # Aruba.platform.deprecated('The use of "#original_env" is deprecated') @original_env ||= {} end |
#output_from(cmd) ⇒ Object
Fetch output (stdout, stderr) from command
727 728 729 730 731 |
# File 'lib/aruba/api/deprecated.rb', line 727 def output_from(cmd) # Aruba.platform.deprecated('The use of "#output_from" is deprecated') process_monitor.output_from(cmd) end |
#prep_for_fs_check(&block) ⇒ Object
287 288 289 290 291 292 293 |
# File 'lib/aruba/api/deprecated.rb', line 287 def prep_for_fs_check(&block) Aruba.platform.deprecated('The use of "prep_for_fs_check" is deprecated. Use apropriate methods and the new rspec matchers instead') stop_all_commands cd('') { yield } end |
#process_monitor ⇒ Object
882 883 884 885 886 |
# File 'lib/aruba/api/deprecated.rb', line 882 def process_monitor Aruba.platform.deprecated('The use of "#process_monitor" is deprecated.') aruba.command_monitor end |
#processes ⇒ Object
890 891 892 893 894 |
# File 'lib/aruba/api/deprecated.rb', line 890 def processes Aruba.platform.deprecated('The use of "#process_monitor" is deprecated. Please use "#all_commands" instead.') aruba.command_monitor.send(:processes) end |
#register_process(*args) ⇒ Object
708 709 710 711 712 |
# File 'lib/aruba/api/deprecated.rb', line 708 def register_process(*args) # Aruba.platform.deprecated('The use of "#register_process" is deprecated') process_monitor.register_process(*args) end |
#remove_dir(*args) ⇒ Object
172 173 174 175 |
# File 'lib/aruba/api/deprecated.rb', line 172 def remove_dir(*args) Aruba.platform.deprecated('The use of "remove_dir" is deprecated. Use "remove" instead') remove(*args) end |
#remove_directory(*args) ⇒ Object
Remove directory
166 167 168 169 |
# File 'lib/aruba/api/deprecated.rb', line 166 def remove_directory(*args) Aruba.platform.deprecated('The use of "remove_directory" is deprecated. Use "remove" instead') remove(*args) end |
#remove_file(*args) ⇒ Object
Remove file
149 150 151 152 153 |
# File 'lib/aruba/api/deprecated.rb', line 149 def remove_file(*args) Aruba.platform.deprecated('The use of "#remove_file" is deprecated. Use "#remove" instead') remove(*args) end |
#restore_env ⇒ Object
Restore original process environment
397 398 399 400 401 402 403 404 405 406 407 408 409 410 |
# File 'lib/aruba/api/deprecated.rb', line 397 def restore_env # No output because we need to reset env on each scenario/spec run # Aruba.platform.deprecated('The use of "#restore_env" is deprecated. If you use "set_environment_variable" there\'s no need to restore the environment') # original_env.each do |key, value| if value ENV[key] = value aruba.environment[key] = value else aruba.environment.delete key ENV.delete key end end end |
#root_directory ⇒ Object
The root directory of aruba
508 509 510 511 512 |
# File 'lib/aruba/api/deprecated.rb', line 508 def root_directory Aruba.platform.deprecated('The use of "#root_directory" is deprecated. Use "aruba.root_directory" instead') aruba.root_directory end |
#run_interactive(cmd) ⇒ Object
Run a command interactively
120 121 122 123 124 |
# File 'lib/aruba/api/deprecated.rb', line 120 def run_interactive(cmd) Aruba.platform.deprecated('The use of "#run_interactive" is deprecated. You can simply use "run" instead') run(cmd) end |
#set_env(key, value) ⇒ Object
Set environment variable
420 421 422 423 424 425 426 427 428 |
# File 'lib/aruba/api/deprecated.rb', line 420 def set_env(key, value) Aruba.platform.deprecated('The use of "#set_env" is deprecated. Please use "set_environment_variable" instead. But be careful, this method uses a different kind of implementation') aruba.announcer.announce(:environment, key, value) set_environment_variable key, value original_env[key] = ENV.delete(key) unless original_env.key? key ENV[key] = value end |
#stderr_from(cmd) ⇒ Object
Fetch stderr from command
751 752 753 754 755 |
# File 'lib/aruba/api/deprecated.rb', line 751 def stderr_from(cmd) # Aruba.platform.deprecated('The use of "#stderr_from" is deprecated') process_monitor.stderr_from(cmd) end |
#stdout_from(cmd) ⇒ Object
Fetch stdout from command
739 740 741 742 743 |
# File 'lib/aruba/api/deprecated.rb', line 739 def stdout_from(cmd) # Aruba.platform.deprecated('The use of "#stdout_from" is deprecated') process_monitor.stdout_from(cmd) end |
#stop_process(process) ⇒ Object
833 834 835 836 837 |
# File 'lib/aruba/api/deprecated.rb', line 833 def stop_process(process) # Aruba.platform.deprecated('The use of "#stop_process" is deprecated. Use "#last_command_(started|stopped).stop" instead') @last_exit_status = process_monitor.stop_process(process) end |
#stop_processes! ⇒ Object
847 848 849 850 851 |
# File 'lib/aruba/api/deprecated.rb', line 847 def stop_processes! Aruba.platform.deprecated('The use of "#stop_processes!" is deprecated. Use "#stop_all_commands" instead') stop_all_commands end |
#terminate_process(process) ⇒ Object
840 841 842 843 844 |
# File 'lib/aruba/api/deprecated.rb', line 840 def terminate_process(process) # Aruba.platform.deprecated('The use of "#terminate_process" is deprecated. Use "#last_command_(started|stopped).terminate" instead') process_monitor.terminate_process(process) end |
#terminate_processes! ⇒ Object
Terminate all running processes
856 857 858 859 860 |
# File 'lib/aruba/api/deprecated.rb', line 856 def terminate_processes! Aruba.platform.deprecated('The use of "#stop_processes!" is deprecated. Use "all_commands.each(&:terminate)" instead') all_commands.each(&:terminate) end |
#touch_file(*args) ⇒ Object
Create an empty file
131 132 133 134 135 |
# File 'lib/aruba/api/deprecated.rb', line 131 def touch_file(*args) Aruba.platform.deprecated('The use of "#touch_file" is deprecated. Use "#touch" instead') touch(*args) end |
#unescape(string, keep_ansi = false) ⇒ Object
Unescape string
497 498 499 500 501 502 503 504 |
# File 'lib/aruba/api/deprecated.rb', line 497 def unescape(string, keep_ansi = false) Aruba.platform.deprecated('The use of "#unescape" is deprecated. Please use "#sanitize_text" intead') string = unescape_text(string) string = extract_text(string) if !keep_ansi || !aruba.config.keep_ansi || aruba.config.remove_ansi_escape_sequences string end |
#with_env(env = {}) { ... } ⇒ Object
Run block with environment
385 386 387 388 389 390 391 392 393 |
# File 'lib/aruba/api/deprecated.rb', line 385 def with_env(env = {}, &block) Aruba.platform.deprecated('The use of "#with_env" is deprecated. Use "#with_environment {}" instead. But be careful this uses a different implementation') env.each do |k,v| set_env k, v end yield restore_env end |