aruba 1.0.0.pre.alpha.2 → 1.0.0.pre.alpha.3
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.
- checksums.yaml +5 -5
 - data/.github/PULL_REQUEST_TEMPLATE.md +2 -1
 - data/.rubocop.yml +6 -181
 - data/.rubocop_todo.yml +364 -0
 - data/.travis.yml +63 -34
 - data/.yardopts +3 -0
 - data/CHANGELOG.md +1121 -0
 - data/CONTRIBUTING.md +179 -78
 - data/Gemfile +29 -44
 - data/README.md +41 -11
 - data/Rakefile +35 -35
 - data/appveyor.yml +6 -5
 - data/aruba.gemspec +14 -16
 - data/bin/console +2 -11
 - data/cucumber.yml +0 -7
 - data/fixtures/cli-app/README.md +1 -1
 - data/fixtures/cli-app/Rakefile +1 -1
 - data/fixtures/cli-app/cli-app.gemspec +1 -0
 - data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +3 -3
 - data/fixtures/cli-app/lib/cli/app/version.rb +1 -1
 - data/fixtures/empty-app/Rakefile +1 -1
 - data/fixtures/empty-app/cli-app.gemspec +1 -0
 - data/fixtures/empty-app/lib/cli/app/version.rb +1 -1
 - data/fixtures/getting-started-app/Gemfile +1 -1
 - data/lib/aruba/api.rb +3 -10
 - data/lib/aruba/api/bundler.rb +16 -0
 - data/lib/aruba/api/commands.rb +249 -0
 - data/lib/aruba/api/core.rb +24 -10
 - data/lib/aruba/api/environment.rb +12 -7
 - data/lib/aruba/api/filesystem.rb +22 -20
 - data/lib/aruba/api/text.rb +3 -9
 - data/lib/aruba/aruba_path.rb +3 -18
 - data/lib/aruba/basic_configuration.rb +3 -19
 - data/lib/aruba/cli.rb +1 -1
 - data/lib/aruba/colorizer.rb +33 -33
 - data/lib/aruba/command.rb +4 -0
 - data/lib/aruba/config_wrapper.rb +1 -1
 - data/lib/aruba/configuration.rb +78 -0
 - data/lib/aruba/console.rb +5 -5
 - data/lib/aruba/console/help.rb +1 -1
 - data/lib/aruba/cucumber.rb +0 -1
 - data/lib/aruba/cucumber/command.rb +55 -115
 - data/lib/aruba/cucumber/environment.rb +1 -1
 - data/lib/aruba/cucumber/file.rb +9 -21
 - data/lib/aruba/cucumber/hooks.rb +6 -62
 - data/lib/aruba/event_bus/name_resolver.rb +1 -2
 - data/lib/aruba/hooks.rb +1 -1
 - data/lib/aruba/initializer.rb +3 -3
 - data/lib/aruba/matchers/base/base_matcher.rb +2 -2
 - data/lib/aruba/matchers/base/message_indenter.rb +19 -0
 - data/lib/aruba/matchers/base/object_formatter.rb +2 -2
 - data/lib/aruba/matchers/collection/include_an_object.rb +7 -9
 - data/lib/aruba/matchers/command/be_successfully_executed.rb +2 -4
 - data/lib/aruba/matchers/command/have_exit_status.rb +1 -1
 - data/lib/aruba/matchers/command/have_finished_in_time.rb +2 -4
 - data/lib/aruba/matchers/command/have_output.rb +9 -4
 - data/lib/aruba/matchers/command/have_output_on_stderr.rb +1 -1
 - data/lib/aruba/matchers/command/have_output_on_stdout.rb +1 -1
 - data/lib/aruba/matchers/command/have_output_size.rb +1 -1
 - data/lib/aruba/matchers/directory/be_an_existing_directory.rb +4 -6
 - data/lib/aruba/matchers/directory/have_sub_directory.rb +4 -6
 - data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +2 -4
 - data/lib/aruba/matchers/file/be_an_existing_executable.rb +4 -6
 - data/lib/aruba/matchers/file/be_an_existing_file.rb +4 -6
 - data/lib/aruba/matchers/file/have_file_content.rb +4 -4
 - data/lib/aruba/matchers/file/have_file_size.rb +6 -8
 - data/lib/aruba/matchers/file/have_same_file_content.rb +9 -12
 - data/lib/aruba/matchers/path/a_path_matching_pattern.rb +2 -4
 - data/lib/aruba/matchers/path/be_an_absolute_path.rb +3 -5
 - data/lib/aruba/matchers/path/be_an_existing_path.rb +4 -6
 - data/lib/aruba/matchers/path/have_permissions.rb +6 -8
 - data/lib/aruba/matchers/string/include_output_string.rb +8 -10
 - data/lib/aruba/matchers/string/match_output_string.rb +9 -11
 - data/lib/aruba/matchers/string/output_string_eq.rb +7 -9
 - data/lib/aruba/platform.rb +0 -1
 - data/lib/aruba/platforms/announcer.rb +26 -70
 - data/lib/aruba/platforms/aruba_file_creator.rb +1 -1
 - data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +2 -2
 - data/lib/aruba/platforms/aruba_logger.rb +22 -2
 - data/lib/aruba/platforms/command_monitor.rb +2 -125
 - data/lib/aruba/platforms/filesystem_status.rb +9 -9
 - data/lib/aruba/platforms/local_environment.rb +2 -2
 - data/lib/aruba/platforms/simple_table.rb +3 -3
 - data/lib/aruba/platforms/unix_command_string.rb +7 -4
 - data/lib/aruba/platforms/unix_environment_variables.rb +9 -13
 - data/lib/aruba/platforms/unix_platform.rb +2 -27
 - data/lib/aruba/platforms/unix_which.rb +2 -1
 - data/lib/aruba/platforms/windows_command_string.rb +20 -7
 - data/lib/aruba/platforms/windows_environment_variables.rb +35 -30
 - data/lib/aruba/platforms/windows_which.rb +4 -3
 - data/lib/aruba/processes/basic_process.rb +11 -15
 - data/lib/aruba/processes/debug_process.rb +5 -0
 - data/lib/aruba/processes/in_process.rb +17 -8
 - data/lib/aruba/processes/spawn_process.rb +35 -23
 - data/lib/aruba/rspec.rb +9 -22
 - data/lib/aruba/runtime.rb +7 -5
 - data/lib/aruba/setup.rb +6 -4
 - data/lib/aruba/tasks/docker_helpers.rb +1 -1
 - data/lib/aruba/version.rb +1 -1
 - metadata +37 -57
 - data/History.md +0 -612
 - data/bin/bootstrap +0 -34
 - data/fixtures/spawn_process/stderr.sh +0 -3
 - data/lib/aruba/api/command.rb +0 -309
 - data/lib/aruba/api/deprecated.rb +0 -895
 - data/lib/aruba/api/rvm.rb +0 -44
 - data/lib/aruba/config.rb +0 -101
 - data/lib/aruba/cucumber/rvm.rb +0 -3
 - data/lib/aruba/in_process.rb +0 -14
 - data/lib/aruba/jruby.rb +0 -4
 - data/lib/aruba/matchers/path/match_path_pattern.rb +0 -41
 - data/lib/aruba/matchers/rspec_matcher_include_regexp.rb +0 -25
 - data/lib/aruba/spawn_process.rb +0 -11
 
    
        data/lib/aruba/cucumber/hooks.rb
    CHANGED
    
    | 
         @@ -3,10 +3,8 @@ require 'aruba/api' 
     | 
|
| 
       3 
3 
     | 
    
         
             
            require 'aruba/platform'
         
     | 
| 
       4 
4 
     | 
    
         
             
            World(Aruba::Api)
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
               
     | 
| 
       8 
     | 
    
         
            -
                with_environment(&block)
         
     | 
| 
       9 
     | 
    
         
            -
              end
         
     | 
| 
      
 6 
     | 
    
         
            +
            Around do |_, block|
         
     | 
| 
      
 7 
     | 
    
         
            +
              with_environment(&block)
         
     | 
| 
       10 
8 
     | 
    
         
             
            end
         
     | 
| 
       11 
9 
     | 
    
         | 
| 
       12 
10 
     | 
    
         
             
            Before do
         
     | 
| 
         @@ -16,11 +14,14 @@ Before do 
     | 
|
| 
       16 
14 
     | 
    
         
             
            end
         
     | 
| 
       17 
15 
     | 
    
         | 
| 
       18 
16 
     | 
    
         
             
            After do
         
     | 
| 
       19 
     | 
    
         
            -
              restore_env
         
     | 
| 
       20 
17 
     | 
    
         
             
              terminate_all_commands
         
     | 
| 
       21 
18 
     | 
    
         
             
              aruba.command_monitor.clear
         
     | 
| 
       22 
19 
     | 
    
         
             
            end
         
     | 
| 
       23 
20 
     | 
    
         | 
| 
      
 21 
     | 
    
         
            +
            Before('@no-clobber') do
         
     | 
| 
      
 22 
     | 
    
         
            +
              setup_aruba(false)
         
     | 
| 
      
 23 
     | 
    
         
            +
            end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
       24 
25 
     | 
    
         
             
            Before('~@no-clobber') do
         
     | 
| 
       25 
26 
     | 
    
         
             
              setup_aruba
         
     | 
| 
       26 
27 
     | 
    
         
             
            end
         
     | 
| 
         @@ -41,12 +42,6 @@ Before('@announce-command-filesystem-status') do 
     | 
|
| 
       41 
42 
     | 
    
         
             
              aruba.announcer.activate :command_filesystem_status
         
     | 
| 
       42 
43 
     | 
    
         
             
            end
         
     | 
| 
       43 
44 
     | 
    
         | 
| 
       44 
     | 
    
         
            -
            Before('@announce-cmd') do
         
     | 
| 
       45 
     | 
    
         
            -
              Aruba.platform.deprecated 'The use of "@announce-cmd"-hook is deprecated. Please use "@announce-command"'
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
              aruba.announcer.activate :command
         
     | 
| 
       48 
     | 
    
         
            -
            end
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
45 
     | 
    
         
             
            Before('@announce-output') do
         
     | 
| 
       51 
46 
     | 
    
         
             
              aruba.announcer.activate :stdout
         
     | 
| 
       52 
47 
     | 
    
         
             
              aruba.announcer.activate :stderr
         
     | 
| 
         @@ -60,12 +55,6 @@ Before('@announce-stderr') do 
     | 
|
| 
       60 
55 
     | 
    
         
             
              aruba.announcer.activate :stderr
         
     | 
| 
       61 
56 
     | 
    
         
             
            end
         
     | 
| 
       62 
57 
     | 
    
         | 
| 
       63 
     | 
    
         
            -
            Before('@announce-dir') do
         
     | 
| 
       64 
     | 
    
         
            -
              Aruba.platform.deprecated 'The use of "@announce-dir"-hook is deprecated. Please use "@announce-directory"'
         
     | 
| 
       65 
     | 
    
         
            -
             
     | 
| 
       66 
     | 
    
         
            -
              aruba.announcer.activate :directory
         
     | 
| 
       67 
     | 
    
         
            -
            end
         
     | 
| 
       68 
     | 
    
         
            -
             
     | 
| 
       69 
58 
     | 
    
         
             
            Before('@announce-directory') do
         
     | 
| 
       70 
59 
     | 
    
         
             
              aruba.announcer.activate :directory
         
     | 
| 
       71 
60 
     | 
    
         
             
            end
         
     | 
| 
         @@ -74,28 +63,10 @@ Before('@announce-stop-signal') do 
     | 
|
| 
       74 
63 
     | 
    
         
             
              aruba.announcer.activate :stop_signal
         
     | 
| 
       75 
64 
     | 
    
         
             
            end
         
     | 
| 
       76 
65 
     | 
    
         | 
| 
       77 
     | 
    
         
            -
            Before('@announce-env') do
         
     | 
| 
       78 
     | 
    
         
            -
              Aruba.platform.deprecated 'The use of "@announce-env"-hook is deprecated. Please use "@announce-changed-environment"'
         
     | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
       80 
     | 
    
         
            -
              aruba.announcer.activate :environment
         
     | 
| 
       81 
     | 
    
         
            -
            end
         
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
            Before('@announce-environment') do
         
     | 
| 
       84 
     | 
    
         
            -
              Aruba.platform.deprecated '@announce-environment is deprecated. Use @announce-changed-environment instead'
         
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
       86 
     | 
    
         
            -
              aruba.announcer.activate :changed_environment
         
     | 
| 
       87 
     | 
    
         
            -
            end
         
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
66 
     | 
    
         
             
            Before('@announce-full-environment') do
         
     | 
| 
       90 
67 
     | 
    
         
             
              aruba.announcer.activate :full_environment
         
     | 
| 
       91 
68 
     | 
    
         
             
            end
         
     | 
| 
       92 
69 
     | 
    
         | 
| 
       93 
     | 
    
         
            -
            Before('@announce-modified-environment') do
         
     | 
| 
       94 
     | 
    
         
            -
              Aruba.platform.deprecated '@announce-modified-environment is deprecated. Use @announce-changed-environment instead'
         
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
              aruba.announcer.activate :changed_environment
         
     | 
| 
       97 
     | 
    
         
            -
            end
         
     | 
| 
       98 
     | 
    
         
            -
             
     | 
| 
       99 
70 
     | 
    
         
             
            Before('@announce-changed-environment') do
         
     | 
| 
       100 
71 
     | 
    
         
             
              aruba.announcer.activate :changed_environment
         
     | 
| 
       101 
72 
     | 
    
         
             
            end
         
     | 
| 
         @@ -124,23 +95,8 @@ Before('@announce') do 
     | 
|
| 
       124 
95 
     | 
    
         
             
              aruba.announcer.activate :command_filesystem_status
         
     | 
| 
       125 
96 
     | 
    
         
             
            end
         
     | 
| 
       126 
97 
     | 
    
         | 
| 
       127 
     | 
    
         
            -
            Before('@ansi') do
         
     | 
| 
       128 
     | 
    
         
            -
              # rubocop:disable Metrics/LineLength
         
     | 
| 
       129 
     | 
    
         
            -
              Aruba::Platform.deprecated('The use of "@ansi" is deprecated. Use "@keep-ansi-escape-sequences" instead. But be aware, that this hook uses the aruba configuration and not an instance variable')
         
     | 
| 
       130 
     | 
    
         
            -
              # rubocop:enable Metrics/LineLength
         
     | 
| 
       131 
     | 
    
         
            -
             
     | 
| 
       132 
     | 
    
         
            -
              aruba.config.remove_ansi_escape_sequences = false
         
     | 
| 
       133 
     | 
    
         
            -
            end
         
     | 
| 
       134 
     | 
    
         
            -
             
     | 
| 
       135 
98 
     | 
    
         
             
            Before('@keep-ansi-escape-sequences') do
         
     | 
| 
       136 
99 
     | 
    
         
             
              aruba.config.remove_ansi_escape_sequences = false
         
     | 
| 
       137 
     | 
    
         
            -
              aruba.config.keep_ansi = true
         
     | 
| 
       138 
     | 
    
         
            -
            end
         
     | 
| 
       139 
     | 
    
         
            -
             
     | 
| 
       140 
     | 
    
         
            -
            Before '@mocked_home_directory' do
         
     | 
| 
       141 
     | 
    
         
            -
              Aruba.platform.deprecated('The use of "@mocked_home_directory" is deprecated. Use "@mocked-home-directory" instead')
         
     | 
| 
       142 
     | 
    
         
            -
             
     | 
| 
       143 
     | 
    
         
            -
              set_environment_variable 'HOME', expand_path('.')
         
     | 
| 
       144 
100 
     | 
    
         
             
            end
         
     | 
| 
       145 
101 
     | 
    
         | 
| 
       146 
102 
     | 
    
         
             
            Before '@mocked-home-directory' do
         
     | 
| 
         @@ -151,18 +107,6 @@ Before('@disable-bundler') do 
     | 
|
| 
       151 
107 
     | 
    
         
             
              unset_bundler_env_vars
         
     | 
| 
       152 
108 
     | 
    
         
             
            end
         
     | 
| 
       153 
109 
     | 
    
         | 
| 
       154 
     | 
    
         
            -
            Before('@spawn') do
         
     | 
| 
       155 
     | 
    
         
            -
              Aruba.platform.deprecated('The use of "@spawn" is deprecated. Use "@command-launcher-spawn" instead')
         
     | 
| 
       156 
     | 
    
         
            -
             
     | 
| 
       157 
     | 
    
         
            -
              aruba.config.command_launcher = :spawn
         
     | 
| 
       158 
     | 
    
         
            -
            end
         
     | 
| 
       159 
     | 
    
         
            -
             
     | 
| 
       160 
     | 
    
         
            -
            Before('@in_process') do
         
     | 
| 
       161 
     | 
    
         
            -
              Aruba.platform.deprecated('The use of "@in_process" is deprecated. Use "@command-launcher-in-process" instead')
         
     | 
| 
       162 
     | 
    
         
            -
             
     | 
| 
       163 
     | 
    
         
            -
              aruba.config.command_launcher = :in_process
         
     | 
| 
       164 
     | 
    
         
            -
            end
         
     | 
| 
       165 
     | 
    
         
            -
             
     | 
| 
       166 
110 
     | 
    
         
             
            Before('@debug') do
         
     | 
| 
       167 
111 
     | 
    
         
             
              aruba.config.command_launcher = :debug
         
     | 
| 
       168 
112 
     | 
    
         
             
            end
         
     | 
| 
         @@ -37,13 +37,12 @@ module Aruba 
     | 
|
| 
       37 
37 
     | 
    
         | 
| 
       38 
38 
     | 
    
         
             
                          # Go down the ancestors to check if it is owned directly. The check
         
     | 
| 
       39 
39 
     | 
    
         
             
                          # stops when we reach Object or the end of ancestors tree.
         
     | 
| 
       40 
     | 
    
         
            -
                          # rubocop:disable Style/EachWithObject
         
     | 
| 
       41 
40 
     | 
    
         
             
                          constant = constant.ancestors.inject do |const, ancestor|
         
     | 
| 
       42 
41 
     | 
    
         
             
                            break const    if ancestor == Object
         
     | 
| 
       43 
42 
     | 
    
         
             
                            break ancestor if ancestor.const_defined?(name, false)
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
       44 
44 
     | 
    
         
             
                            const
         
     | 
| 
       45 
45 
     | 
    
         
             
                          end
         
     | 
| 
       46 
     | 
    
         
            -
                          # rubocop:enable Style/EachWithObject
         
     | 
| 
       47 
46 
     | 
    
         | 
| 
       48 
47 
     | 
    
         
             
                          # owner is in Object, so raise
         
     | 
| 
       49 
48 
     | 
    
         
             
                          constant.const_get(name, false)
         
     | 
    
        data/lib/aruba/hooks.rb
    CHANGED
    
    | 
         @@ -18,7 +18,7 @@ module Aruba 
     | 
|
| 
       18 
18 
     | 
    
         
             
                # @param [String, Symbol] label
         
     | 
| 
       19 
19 
     | 
    
         
             
                #   The name of the hook
         
     | 
| 
       20 
20 
     | 
    
         
             
                #
         
     | 
| 
       21 
     | 
    
         
            -
                # @ 
     | 
| 
      
 21 
     | 
    
         
            +
                # @param [Proc] block
         
     | 
| 
       22 
22 
     | 
    
         
             
                #   The block which should be run for the hook
         
     | 
| 
       23 
23 
     | 
    
         
             
                def append(label, block)
         
     | 
| 
       24 
24 
     | 
    
         
             
                  if store.key?(label.to_sym) && store[label.to_sym].respond_to?(:<<)
         
     | 
    
        data/lib/aruba/initializer.rb
    CHANGED
    
    | 
         @@ -68,7 +68,7 @@ module Aruba 
     | 
|
| 
       68 
68 
     | 
    
         | 
| 
       69 
69 
     | 
    
         
             
                  no_commands do
         
     | 
| 
       70 
70 
     | 
    
         
             
                    def self.match?(framework)
         
     | 
| 
       71 
     | 
    
         
            -
                       
     | 
| 
      
 71 
     | 
    
         
            +
                      framework.downcase.to_sym == :rspec
         
     | 
| 
       72 
72 
     | 
    
         
             
                    end
         
     | 
| 
       73 
73 
     | 
    
         
             
                  end
         
     | 
| 
       74 
74 
     | 
    
         | 
| 
         @@ -109,7 +109,7 @@ module Aruba 
     | 
|
| 
       109 
109 
     | 
    
         | 
| 
       110 
110 
     | 
    
         
             
                  no_commands do
         
     | 
| 
       111 
111 
     | 
    
         
             
                    def self.match?(framework)
         
     | 
| 
       112 
     | 
    
         
            -
                       
     | 
| 
      
 112 
     | 
    
         
            +
                      framework.downcase.to_sym == :cucumber
         
     | 
| 
       113 
113 
     | 
    
         
             
                    end
         
     | 
| 
       114 
114 
     | 
    
         
             
                  end
         
     | 
| 
       115 
115 
     | 
    
         | 
| 
         @@ -134,7 +134,7 @@ module Aruba 
     | 
|
| 
       134 
134 
     | 
    
         | 
| 
       135 
135 
     | 
    
         
             
                  no_commands do
         
     | 
| 
       136 
136 
     | 
    
         
             
                    def self.match?(framework)
         
     | 
| 
       137 
     | 
    
         
            -
                       
     | 
| 
      
 137 
     | 
    
         
            +
                      framework.downcase.to_sym == :minitest
         
     | 
| 
       138 
138 
     | 
    
         
             
                    end
         
     | 
| 
       139 
139 
     | 
    
         
             
                  end
         
     | 
| 
       140 
140 
     | 
    
         | 
| 
         @@ -72,14 +72,14 @@ module Aruba 
     | 
|
| 
       72 
72 
     | 
    
         
             
                    end
         
     | 
| 
       73 
73 
     | 
    
         | 
| 
       74 
74 
     | 
    
         
             
                    # @private
         
     | 
| 
       75 
     | 
    
         
            -
                    # rubocop:disable  
     | 
| 
      
 75 
     | 
    
         
            +
                    # rubocop:disable Naming/PredicateName
         
     | 
| 
       76 
76 
     | 
    
         
             
                    def self.has_default_failure_messages?(matcher)
         
     | 
| 
       77 
77 
     | 
    
         
             
                      matcher.method(:failure_message).owner == self &&
         
     | 
| 
       78 
78 
     | 
    
         
             
                        matcher.method(:failure_message_when_negated).owner == self
         
     | 
| 
       79 
79 
     | 
    
         
             
                    rescue NameError
         
     | 
| 
       80 
80 
     | 
    
         
             
                      false
         
     | 
| 
       81 
81 
     | 
    
         
             
                    end
         
     | 
| 
       82 
     | 
    
         
            -
                    # rubocop:enable  
     | 
| 
      
 82 
     | 
    
         
            +
                    # rubocop:enable Naming/PredicateName
         
     | 
| 
       83 
83 
     | 
    
         
             
                  end
         
     | 
| 
       84 
84 
     | 
    
         | 
| 
       85 
85 
     | 
    
         
             
                  include DefaultFailureMessages
         
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Aruba
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Matchers
         
     | 
| 
      
 3 
     | 
    
         
            +
                module Base
         
     | 
| 
      
 4 
     | 
    
         
            +
                  # Provide #indent_multiline_message helper method.
         
     | 
| 
      
 5 
     | 
    
         
            +
                  #
         
     | 
| 
      
 6 
     | 
    
         
            +
                  # @api private
         
     | 
| 
      
 7 
     | 
    
         
            +
                  module MessageIndenter
         
     | 
| 
      
 8 
     | 
    
         
            +
                    module_function
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                    def indent_multiline_message(message)
         
     | 
| 
      
 11 
     | 
    
         
            +
                      message = message.sub(/\n+\z/, '')
         
     | 
| 
      
 12 
     | 
    
         
            +
                      message.lines.map do |line|
         
     | 
| 
      
 13 
     | 
    
         
            +
                        line =~ /\S/ ? '   ' + line : line
         
     | 
| 
      
 14 
     | 
    
         
            +
                      end.join
         
     | 
| 
      
 15 
     | 
    
         
            +
                    end
         
     | 
| 
      
 16 
     | 
    
         
            +
                  end
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -57,7 +57,7 @@ module Aruba 
     | 
|
| 
       57 
57 
     | 
    
         
             
                    end
         
     | 
| 
       58 
58 
     | 
    
         
             
                  end
         
     | 
| 
       59 
59 
     | 
    
         | 
| 
       60 
     | 
    
         
            -
                  TIME_FORMAT =  
     | 
| 
      
 60 
     | 
    
         
            +
                  TIME_FORMAT = '%Y-%m-%d %H:%M:%S'.freeze
         
     | 
| 
       61 
61 
     | 
    
         | 
| 
       62 
62 
     | 
    
         
             
                  if Time.method_defined?(:nsec)
         
     | 
| 
       63 
63 
     | 
    
         
             
                    # @private
         
     | 
| 
         @@ -66,7 +66,7 @@ module Aruba 
     | 
|
| 
       66 
66 
     | 
    
         
             
                    end
         
     | 
| 
       67 
67 
     | 
    
         
             
                  end
         
     | 
| 
       68 
68 
     | 
    
         | 
| 
       69 
     | 
    
         
            -
                  DATE_TIME_FORMAT =  
     | 
| 
      
 69 
     | 
    
         
            +
                  DATE_TIME_FORMAT = '%a, %d %b %Y %H:%M:%S.%N %z'.freeze
         
     | 
| 
       70 
70 
     | 
    
         | 
| 
       71 
71 
     | 
    
         
             
                  # ActiveSupport sometimes overrides inspect. If `ActiveSupport` is
         
     | 
| 
       72 
72 
     | 
    
         
             
                  # defined use a custom format string that includes more time precision.
         
     | 
| 
         @@ -1,4 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'aruba/matchers/base/base_matcher'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'aruba/matchers/base/message_indenter'
         
     | 
| 
       2 
3 
     | 
    
         | 
| 
       3 
4 
     | 
    
         
             
            # Aruba
         
     | 
| 
       4 
5 
     | 
    
         
             
            module Aruba
         
     | 
| 
         @@ -8,6 +9,8 @@ module Aruba 
     | 
|
| 
       8 
9 
     | 
    
         
             
                # Provides the implementation for `include_an_object`.
         
     | 
| 
       9 
10 
     | 
    
         
             
                # Not intended to be instantiated directly.
         
     | 
| 
       10 
11 
     | 
    
         
             
                class IncludeAnObject < BaseMatcher
         
     | 
| 
      
 12 
     | 
    
         
            +
                  include Base::MessageIndenter
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
       11 
14 
     | 
    
         
             
                  protected
         
     | 
| 
       12 
15 
     | 
    
         | 
| 
       13 
16 
     | 
    
         
             
                  # @private
         
     | 
| 
         @@ -19,7 +22,7 @@ module Aruba 
     | 
|
| 
       19 
22 
     | 
    
         | 
| 
       20 
23 
     | 
    
         
             
                  def initialize(matcher)
         
     | 
| 
       21 
24 
     | 
    
         
             
                    @matcher              = matcher
         
     | 
| 
       22 
     | 
    
         
            -
                    @failed_objects       =  
     | 
| 
      
 25 
     | 
    
         
            +
                    @failed_objects       = []
         
     | 
| 
       23 
26 
     | 
    
         
             
                    @any_succeeded_object = false
         
     | 
| 
       24 
27 
     | 
    
         
             
                  end
         
     | 
| 
       25 
28 
     | 
    
         | 
| 
         @@ -30,8 +33,10 @@ module Aruba 
     | 
|
| 
       30 
33 
     | 
    
         
             
                      return "#{improve_hash_formatting(super)}, but was not iterable"
         
     | 
| 
       31 
34 
     | 
    
         
             
                    end
         
     | 
| 
       32 
35 
     | 
    
         | 
| 
      
 36 
     | 
    
         
            +
                    return failed_objects.first if failed_objects.size == 1
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
       33 
38 
     | 
    
         
             
                    all_messages = [improve_hash_formatting(super)]
         
     | 
| 
       34 
     | 
    
         
            -
                    failed_objects. 
     | 
| 
      
 39 
     | 
    
         
            +
                    failed_objects.each_with_index do |matcher_failure_message, index|
         
     | 
| 
       35 
40 
     | 
    
         
             
                      all_messages << failure_message_for_item(index, matcher_failure_message)
         
     | 
| 
       36 
41 
     | 
    
         
             
                    end
         
     | 
| 
       37 
42 
     | 
    
         
             
                    all_messages.join("\n\n")
         
     | 
| 
         @@ -92,13 +97,6 @@ module Aruba 
     | 
|
| 
       92 
97 
     | 
    
         
             
                  def add_new_line_if_needed(message)
         
     | 
| 
       93 
98 
     | 
    
         
             
                    message.start_with?("\n") ? message : "\n#{message}"
         
     | 
| 
       94 
99 
     | 
    
         
             
                  end
         
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
                  def indent_multiline_message(message)
         
     | 
| 
       97 
     | 
    
         
            -
                    message = message.sub(/\n+\z/, '')
         
     | 
| 
       98 
     | 
    
         
            -
                    message.lines.map do |line|
         
     | 
| 
       99 
     | 
    
         
            -
                      line =~ /\S/ ? '   ' + line : line
         
     | 
| 
       100 
     | 
    
         
            -
                    end.join
         
     | 
| 
       101 
     | 
    
         
            -
                  end
         
     | 
| 
       102 
100 
     | 
    
         
             
                end
         
     | 
| 
       103 
101 
     | 
    
         
             
              end
         
     | 
| 
       104 
102 
     | 
    
         
             
            end
         
     | 
| 
         @@ -6,7 +6,7 @@ require 'aruba/matchers/command/have_finished_in_time' 
     | 
|
| 
       6 
6 
     | 
    
         
             
            # @!method be_successfuly_executed
         
     | 
| 
       7 
7 
     | 
    
         
             
            #   This matchers checks if execution of <command> was successful
         
     | 
| 
       8 
8 
     | 
    
         
             
            #
         
     | 
| 
       9 
     | 
    
         
            -
            #   @return [ 
     | 
| 
      
 9 
     | 
    
         
            +
            #   @return [Boolean] The result
         
     | 
| 
       10 
10 
     | 
    
         
             
            #
         
     | 
| 
       11 
11 
     | 
    
         
             
            #     false:
         
     | 
| 
       12 
12 
     | 
    
         
             
            #     * if command was not successful
         
     | 
| 
         @@ -29,6 +29,4 @@ RSpec::Matchers.define :be_successfully_executed do 
     | 
|
| 
       29 
29 
     | 
    
         
             
              end
         
     | 
| 
       30 
30 
     | 
    
         
             
            end
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
              RSpec::Matchers.define_negated_matcher :have_failed_running, :be_successfully_executed
         
     | 
| 
       34 
     | 
    
         
            -
            end
         
     | 
| 
      
 32 
     | 
    
         
            +
            RSpec::Matchers.define_negated_matcher :have_failed_running, :be_successfully_executed
         
     | 
| 
         @@ -4,7 +4,7 @@ require 'rspec/expectations/version' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            #   This matchers checks if <command> run too long. Say the timeout is 10
         
     | 
| 
       5 
5 
     | 
    
         
             
            #   seconds and it takes <command> to finish in 15. This matchers will succeed.
         
     | 
| 
       6 
6 
     | 
    
         
             
            #
         
     | 
| 
       7 
     | 
    
         
            -
            #   @return [ 
     | 
| 
      
 7 
     | 
    
         
            +
            #   @return [Boolean] The result
         
     | 
| 
       8 
8 
     | 
    
         
             
            #
         
     | 
| 
       9 
9 
     | 
    
         
             
            #     false:
         
     | 
| 
       10 
10 
     | 
    
         
             
            #     * if command not to run too long
         
     | 
| 
         @@ -32,6 +32,4 @@ RSpec::Matchers.define :have_finished_in_time do 
     | 
|
| 
       32 
32 
     | 
    
         
             
              end
         
     | 
| 
       33 
33 
     | 
    
         
             
            end
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
              RSpec::Matchers.define_negated_matcher :run_too_long, :have_finished_in_time
         
     | 
| 
       37 
     | 
    
         
            -
            end
         
     | 
| 
      
 35 
     | 
    
         
            +
            RSpec::Matchers.define_negated_matcher :run_too_long, :have_finished_in_time
         
     | 
| 
         @@ -1,7 +1,9 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'aruba/matchers/base/message_indenter'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            # @!method have_output
         
     | 
| 
       2 
4 
     | 
    
         
             
            #   This matchers checks if <command> has created output
         
     | 
| 
       3 
5 
     | 
    
         
             
            #
         
     | 
| 
       4 
     | 
    
         
            -
            #   @return [ 
     | 
| 
      
 6 
     | 
    
         
            +
            #   @return [Boolean] The result
         
     | 
| 
       5 
7 
     | 
    
         
             
            #
         
     | 
| 
       6 
8 
     | 
    
         
             
            #     false:
         
     | 
| 
       7 
9 
     | 
    
         
             
            #     * if command has not created output
         
     | 
| 
         @@ -29,8 +31,11 @@ RSpec::Matchers.define :have_output do |expected| 
     | 
|
| 
       29 
31 
     | 
    
         
             
              diffable
         
     | 
| 
       30 
32 
     | 
    
         | 
| 
       31 
33 
     | 
    
         
             
              description { "have output: #{description_of expected}" }
         
     | 
| 
       32 
     | 
    
         
            -
            end
         
     | 
| 
       33 
34 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
      
 35 
     | 
    
         
            +
              failure_message do |_actual|
         
     | 
| 
      
 36 
     | 
    
         
            +
                "expected `#{@old_actual.commandline}` to have output #{description_of expected}\n" \
         
     | 
| 
      
 37 
     | 
    
         
            +
                  "but was:\n#{Aruba::Matchers::Base::MessageIndenter.indent_multiline_message @actual}"
         
     | 
| 
      
 38 
     | 
    
         
            +
              end
         
     | 
| 
       36 
39 
     | 
    
         
             
            end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            RSpec::Matchers.alias_matcher :a_command_having_output, :have_output
         
     | 
| 
         @@ -3,7 +3,7 @@ require 'rspec/expectations/version' 
     | 
|
| 
       3 
3 
     | 
    
         
             
            # @!method be_an_existing_directory
         
     | 
| 
       4 
4 
     | 
    
         
             
            #   This matchers checks if <directory> exists in filesystem
         
     | 
| 
       5 
5 
     | 
    
         
             
            #
         
     | 
| 
       6 
     | 
    
         
            -
            #   @return [ 
     | 
| 
      
 6 
     | 
    
         
            +
            #   @return [Boolean] The result
         
     | 
| 
       7 
7 
     | 
    
         
             
            #
         
     | 
| 
       8 
8 
     | 
    
         
             
            #     false:
         
     | 
| 
       9 
9 
     | 
    
         
             
            #     * if directory does not exist
         
     | 
| 
         @@ -25,14 +25,12 @@ RSpec::Matchers.define :be_an_existing_directory do |_| 
     | 
|
| 
       25 
25 
     | 
    
         
             
              end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
27 
     | 
    
         
             
              failure_message do |actual|
         
     | 
| 
       28 
     | 
    
         
            -
                format( 
     | 
| 
      
 28 
     | 
    
         
            +
                format('expected that directory "%s" exists', actual)
         
     | 
| 
       29 
29 
     | 
    
         
             
              end
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
31 
     | 
    
         
             
              failure_message_when_negated do |actual|
         
     | 
| 
       32 
     | 
    
         
            -
                format( 
     | 
| 
      
 32 
     | 
    
         
            +
                format('expected that directory "%s" does not exist', actual)
         
     | 
| 
       33 
33 
     | 
    
         
             
              end
         
     | 
| 
       34 
34 
     | 
    
         
             
            end
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
              RSpec::Matchers.alias_matcher :an_existing_directory, :be_an_existing_directory
         
     | 
| 
       38 
     | 
    
         
            -
            end
         
     | 
| 
      
 36 
     | 
    
         
            +
            RSpec::Matchers.alias_matcher :an_existing_directory, :be_an_existing_directory
         
     | 
| 
         @@ -6,7 +6,7 @@ require 'rspec/expectations/version' 
     | 
|
| 
       6 
6 
     | 
    
         
             
            #   @param [Array] sub_directory
         
     | 
| 
       7 
7 
     | 
    
         
             
            #      A list of sub-directory relative to current directory
         
     | 
| 
       8 
8 
     | 
    
         
             
            #
         
     | 
| 
       9 
     | 
    
         
            -
            #   @return [ 
     | 
| 
      
 9 
     | 
    
         
            +
            #   @return [Boolean] The result
         
     | 
| 
       10 
10 
     | 
    
         
             
            #
         
     | 
| 
       11 
11 
     | 
    
         
             
            #     false:
         
     | 
| 
       12 
12 
     | 
    
         
             
            #     * if directory does not have sub-directory
         
     | 
| 
         @@ -40,14 +40,12 @@ RSpec::Matchers.define :have_sub_directory do |expected| 
     | 
|
| 
       40 
40 
     | 
    
         
             
              diffable
         
     | 
| 
       41 
41 
     | 
    
         | 
| 
       42 
42 
     | 
    
         
             
              failure_message do |actual|
         
     | 
| 
       43 
     | 
    
         
            -
                format( 
     | 
| 
      
 43 
     | 
    
         
            +
                format('expected that directory "%s" has the following sub-directories: %s.', actual.join(', '), expected)
         
     | 
| 
       44 
44 
     | 
    
         
             
              end
         
     | 
| 
       45 
45 
     | 
    
         | 
| 
       46 
46 
     | 
    
         
             
              failure_message_when_negated do |actual|
         
     | 
| 
       47 
     | 
    
         
            -
                format( 
     | 
| 
      
 47 
     | 
    
         
            +
                format('expected that directory "%s" does not have the following sub-directories: %s.', actual.join(', '), expected)
         
     | 
| 
       48 
48 
     | 
    
         
             
              end
         
     | 
| 
       49 
49 
     | 
    
         
             
            end
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
              RSpec::Matchers.alias_matcher :a_directory_having_sub_directory, :have_sub_directory
         
     | 
| 
       53 
     | 
    
         
            -
            end
         
     | 
| 
      
 51 
     | 
    
         
            +
            RSpec::Matchers.alias_matcher :a_directory_having_sub_directory, :have_sub_directory
         
     | 
| 
         @@ -3,7 +3,7 @@ require 'rspec/expectations/version' 
     | 
|
| 
       3 
3 
     | 
    
         
             
            # @!method be_a_command_found_in_path
         
     | 
| 
       4 
4 
     | 
    
         
             
            #   This matchers checks if <command> can be found in path
         
     | 
| 
       5 
5 
     | 
    
         
             
            #
         
     | 
| 
       6 
     | 
    
         
            -
            #   @return [ 
     | 
| 
      
 6 
     | 
    
         
            +
            #   @return [Boolean] The result
         
     | 
| 
       7 
7 
     | 
    
         
             
            #
         
     | 
| 
       8 
8 
     | 
    
         
             
            #     false:
         
     | 
| 
       9 
9 
     | 
    
         
             
            #     * if command was not found in PATH
         
     | 
| 
         @@ -31,6 +31,4 @@ RSpec::Matchers.define :be_a_command_found_in_path do 
     | 
|
| 
       31 
31 
     | 
    
         
             
              end
         
     | 
| 
       32 
32 
     | 
    
         
             
            end
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
              RSpec::Matchers.alias_matcher :a_command_found_in_path, :be_a_command_found_in_path
         
     | 
| 
       36 
     | 
    
         
            -
            end
         
     | 
| 
      
 34 
     | 
    
         
            +
            RSpec::Matchers.alias_matcher :a_command_found_in_path, :be_a_command_found_in_path
         
     |