Skip to content

Commit

Permalink
Wrap long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Apr 11, 2020
1 parent 75310ab commit 3742815
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
16 changes: 4 additions & 12 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-04-11 12:22:18 +0200 using RuboCop version 0.79.0.
# on 2020-04-11 12:33:09 +0200 using RuboCop version 0.79.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -19,13 +19,6 @@ Layout/EmptyLines:
Exclude:
- 'lib/aruba/api/core.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 256

# Offense count: 7
Lint/AmbiguousBlockAssociation:
Exclude:
Expand All @@ -51,12 +44,12 @@ Metrics/AbcSize:
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Max: 587
Max: 593

# Offense count: 2
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 152
Max: 153

# Offense count: 5
Metrics/CyclomaticComplexity:
Expand Down Expand Up @@ -197,11 +190,10 @@ Style/IdenticalConditionalBranches:
Exclude:
- 'lib/aruba/hooks.rb'

# Offense count: 8
# Offense count: 7
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Exclude:
- 'lib/aruba/api/core.rb'
- 'lib/aruba/cucumber/command.rb'
- 'lib/aruba/matchers/collection/include_an_object.rb'
- 'lib/aruba/platforms/unix_environment_variables.rb'
Expand Down
4 changes: 3 additions & 1 deletion lib/aruba/api/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ def expand_path(file_name, dir_string = nil)

fail ArgumentError, message unless file_name.is_a?(String) && !file_name.empty?

fail %(Aruba's working directory does not exist. Maybe you forgot to run `setup_aruba` before using its API.) unless Aruba.platform.directory? File.join(aruba.config.root_directory, aruba.config.working_directory)
unless Aruba.platform.directory? File.join(aruba.config.root_directory, aruba.config.working_directory)
fail %(Aruba's working directory does not exist. Maybe you forgot to run `setup_aruba` before using its API.)
end


prefix = file_name[0]
Expand Down
4 changes: 3 additions & 1 deletion lib/aruba/event_bus/name_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ def initialize(default_namespace)
def transform(event_id)
resolvers.find { |r| r.match? event_id }.new.transform(default_namespace, event_id)
rescue => e
raise EventNameResolveError, %(Transforming "#{event_id}" into an event class failed. Supported types are: #{@resolvers.map(&:supports).flatten.join(', ')}. #{e.message}.\n\n#{e.backtrace.join("\n")})
types = @resolvers.map(&:supports).flatten.join(', ')
message = %(Transforming "#{event_id}" into an event class failed. Supported types are: #{types}. #{e.message}.)
raise EventNameResolveError, message, cause: e
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/aruba/processes/spawn_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def initialize(cmd, exit_timeout, io_wait_timeout, working_directory,
#
def start
if started?
error_message = %(Command "#{commandline}" has already been started. Please `#stop` the command first and `#start` it again. Alternatively use `#restart`.\n#{caller.join("\n")})
error_message = "Command \"#{commandline}\" has already been started." \
' Please `#stop` the command first and `#start` it again. Alternatively use `#restart`.'
fail CommandAlreadyStartedError, error_message
end

Expand Down
8 changes: 7 additions & 1 deletion spec/aruba/api/filesystem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,13 @@

before(:each) { create_test_files(source) }

it { expect { @aruba.copy source, destination }.to raise_error ArgumentError, %(same file: #{File.expand_path(File.join(@aruba.aruba.current_directory, source))} and #{File.expand_path(File.join(@aruba.aruba.current_directory, destination))}) }
it 'raises an appropriate error' do
src_path = File.expand_path(File.join(@aruba.aruba.current_directory, source))
dest_path = File.expand_path(File.join(@aruba.aruba.current_directory, destination))
expected_message = %(same file: #{src_path} and #{dest_path})
expect { @aruba.copy source, destination }
.to raise_error ArgumentError, expected_message
end
end

context 'when a fixture is destination' do
Expand Down

0 comments on commit 3742815

Please sign in to comment.