diff --git a/.rubocop.yml b/.rubocop.yml index 3783e6b75..14c89afd4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -72,11 +72,6 @@ Style/StringLiterals: Style/SymbolArray: EnforcedStyle: brackets -# Code is currently broken with frozen string literal comments applied. -# TODO: Enable and fix build -Style/FrozenStringLiteralComment: - Enabled: false - # Be relatively lenient with line length Layout/LineLength: Max: 94 diff --git a/.simplecov b/.simplecov index d4f5685b6..6fe22f24d 100644 --- a/.simplecov +++ b/.simplecov @@ -1,3 +1,5 @@ +# frozen_string_literal: true + SimpleCov.configure do # Activate branch coverage enable_coverage :branch diff --git a/Gemfile b/Gemfile index 3c7cea132..505ac864d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" # Use dependencies from gemspec diff --git a/Rakefile b/Rakefile index 81d742e99..848ca81f4 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH << File.expand_path(__dir__) require "aruba/platform" diff --git a/aruba.gemspec b/aruba.gemspec index 12faf7853..57a08587a 100644 --- a/aruba.gemspec +++ b/aruba.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "lib/aruba/version" Gem::Specification.new do |spec| diff --git a/bin/console b/bin/console index 1b23406c1..11f3ee2ee 100755 --- a/bin/console +++ b/bin/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $LOAD_PATH.unshift File.expand_path("../lib", __dir__) diff --git a/exe/aruba b/exe/aruba index 6adbd500c..9e3365d21 100755 --- a/exe/aruba +++ b/exe/aruba @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $LOAD_PATH << File.expand_path("../lib", __dir__) diff --git a/features/step_definitions/hooks.rb b/features/step_definitions/hooks.rb index 1facf2c7a..e65a52c59 100644 --- a/features/step_definitions/hooks.rb +++ b/features/step_definitions/hooks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cucumber/platform" Before "@requires-python" do diff --git a/features/support/aruba.rb b/features/support/aruba.rb index cde25f461..1533e51ad 100644 --- a/features/support/aruba.rb +++ b/features/support/aruba.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/cucumber" Aruba.configure do |config| diff --git a/features/support/env.rb b/features/support/env.rb index 4a4e7fb06..27efd8bfe 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift File.expand_path("../../lib", __dir__) # Has to be the first file required so that all other files show coverage information diff --git a/features/support/jruby.rb b/features/support/jruby.rb index 61de3c582..47bede405 100644 --- a/features/support/jruby.rb +++ b/features/support/jruby.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if RUBY_PLATFORM == "java" Before do @aruba_timeout_seconds = 15 diff --git a/features/support/simplecov_setup.rb b/features/support/simplecov_setup.rb index 598dc8673..41d96ce74 100644 --- a/features/support/simplecov_setup.rb +++ b/features/support/simplecov_setup.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @note this file is loaded in env.rb to setup simplecov using RUBYOPTs for # child processes and @in-process unless RUBY_PLATFORM.include?("java") diff --git a/features/support/timing.rb b/features/support/timing.rb index 23b4e3331..4ff1470ef 100644 --- a/features/support/timing.rb +++ b/features/support/timing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # From https://itshouldbeuseful.wordpress.com/2010/11/10/find-your-slowest-running-cucumber-features/ scenario_times = {} diff --git a/fixtures/cli-app/Gemfile b/fixtures/cli-app/Gemfile index ef0ed48d5..1a48fccdf 100644 --- a/fixtures/cli-app/Gemfile +++ b/fixtures/cli-app/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" # Use dependencies from gemspec diff --git a/fixtures/cli-app/Rakefile b/fixtures/cli-app/Rakefile index 29955274e..5263b5839 100644 --- a/fixtures/cli-app/Rakefile +++ b/fixtures/cli-app/Rakefile @@ -1 +1,3 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" diff --git a/fixtures/cli-app/bin/aruba-test-cli b/fixtures/cli-app/bin/aruba-test-cli index 70e0f203e..c4ab1d75d 100755 --- a/fixtures/cli-app/bin/aruba-test-cli +++ b/fixtures/cli-app/bin/aruba-test-cli @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true $LOAD_PATH << File.expand_path("../lib", __dir__) require "cli/app" diff --git a/fixtures/cli-app/cli-app.gemspec b/fixtures/cli-app/cli-app.gemspec index 37f1e5376..f4b99a262 100644 --- a/fixtures/cli-app/cli-app.gemspec +++ b/fixtures/cli-app/cli-app.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "cli/app/version" diff --git a/fixtures/cli-app/features/support/aruba.rb b/fixtures/cli-app/features/support/aruba.rb index ba5a3303d..25a3b5d1d 100644 --- a/fixtures/cli-app/features/support/aruba.rb +++ b/fixtures/cli-app/features/support/aruba.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "aruba/cucumber" diff --git a/fixtures/cli-app/features/support/env.rb b/fixtures/cli-app/features/support/env.rb index 217b8f5eb..deebd5269 100644 --- a/fixtures/cli-app/features/support/env.rb +++ b/fixtures/cli-app/features/support/env.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require_relative "aruba" diff --git a/fixtures/cli-app/lib/cli/app.rb b/fixtures/cli-app/lib/cli/app.rb index 3efb22b8f..532ae4c72 100644 --- a/fixtures/cli-app/lib/cli/app.rb +++ b/fixtures/cli-app/lib/cli/app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/app/version" Dir.glob(File.expand_path("**/*.rb", __dir__)).each { |f| require_relative f } diff --git a/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb b/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb index dce7c16c8..506aa449c 100644 --- a/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +++ b/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SimpleCov module Formatter class HTMLFormatter diff --git a/fixtures/cli-app/lib/cli/app/version.rb b/fixtures/cli-app/lib/cli/app/version.rb index f2f5d822d..69e6983ae 100644 --- a/fixtures/cli-app/lib/cli/app/version.rb +++ b/fixtures/cli-app/lib/cli/app/version.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Cli module App - VERSION = "0.1.0".freeze + VERSION = "0.1.0" end end diff --git a/fixtures/cli-app/script/console b/fixtures/cli-app/script/console index 1a4888ae7..b7f138e67 100755 --- a/fixtures/cli-app/script/console +++ b/fixtures/cli-app/script/console @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "bundler/setup" require "cli/app" diff --git a/fixtures/cli-app/spec/spec_helper.rb b/fixtures/cli-app/spec/spec_helper.rb index 9d67aac75..b8b3e7bec 100644 --- a/fixtures/cli-app/spec/spec_helper.rb +++ b/fixtures/cli-app/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift File.expand_path("../lib", __dir__) require "cli/app" diff --git a/fixtures/cli-app/spec/support/aruba.rb b/fixtures/cli-app/spec/support/aruba.rb index 599d12586..c3219676d 100644 --- a/fixtures/cli-app/spec/support/aruba.rb +++ b/fixtures/cli-app/spec/support/aruba.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "aruba/rspec" diff --git a/fixtures/empty-app/Rakefile b/fixtures/empty-app/Rakefile index 29955274e..5263b5839 100644 --- a/fixtures/empty-app/Rakefile +++ b/fixtures/empty-app/Rakefile @@ -1 +1,3 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" diff --git a/fixtures/empty-app/cli-app.gemspec b/fixtures/empty-app/cli-app.gemspec index de89868fb..511e69af2 100644 --- a/fixtures/empty-app/cli-app.gemspec +++ b/fixtures/empty-app/cli-app.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "cli/app/version" diff --git a/fixtures/empty-app/lib/cli/app.rb b/fixtures/empty-app/lib/cli/app.rb index f46bb8946..9c3e322b7 100644 --- a/fixtures/empty-app/lib/cli/app.rb +++ b/fixtures/empty-app/lib/cli/app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cli/app/version" module Cli diff --git a/fixtures/empty-app/lib/cli/app/version.rb b/fixtures/empty-app/lib/cli/app/version.rb index f2f5d822d..69e6983ae 100644 --- a/fixtures/empty-app/lib/cli/app/version.rb +++ b/fixtures/empty-app/lib/cli/app/version.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Cli module App - VERSION = "0.1.0".freeze + VERSION = "0.1.0" end end diff --git a/fixtures/getting-started-app/Gemfile b/fixtures/getting-started-app/Gemfile index b954be0d1..f0ad83604 100644 --- a/fixtures/getting-started-app/Gemfile +++ b/fixtures/getting-started-app/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" gem "aruba", path: File.expand_path("../../..", __dir__) diff --git a/fixtures/getting-started-app/features/support/env.rb b/fixtures/getting-started-app/features/support/env.rb index ba5a3303d..25a3b5d1d 100644 --- a/fixtures/getting-started-app/features/support/env.rb +++ b/fixtures/getting-started-app/features/support/env.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "aruba/cucumber" diff --git a/gemfiles/cucumber_8.gemfile b/gemfiles/cucumber_8.gemfile index b8f54b2d6..1a63a295e 100644 --- a/gemfiles/cucumber_8.gemfile +++ b/gemfiles/cucumber_8.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/gemfiles/cucumber_9.gemfile b/gemfiles/cucumber_9.gemfile index 37a55d72e..99d460de6 100644 --- a/gemfiles/cucumber_9.gemfile +++ b/gemfiles/cucumber_9.gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file was generated by Appraisal source "https://rubygems.org" diff --git a/lib/aruba.rb b/lib/aruba.rb index dd3a11133..e4afa9406 100644 --- a/lib/aruba.rb +++ b/lib/aruba.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require "aruba/api" diff --git a/lib/aruba/api.rb b/lib/aruba/api.rb index e73620910..1fc2b4299 100644 --- a/lib/aruba/api.rb +++ b/lib/aruba/api.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rspec/expectations" require "shellwords" diff --git a/lib/aruba/api/bundler.rb b/lib/aruba/api/bundler.rb index 64dc3f04e..50e4e2e0c 100644 --- a/lib/aruba/api/bundler.rb +++ b/lib/aruba/api/bundler.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/api/environment" require "bundler" diff --git a/lib/aruba/api/commands.rb b/lib/aruba/api/commands.rb index b2a5fadc0..3273f3ca2 100644 --- a/lib/aruba/api/commands.rb +++ b/lib/aruba/api/commands.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "pathname" require "aruba/platform" diff --git a/lib/aruba/api/core.rb b/lib/aruba/api/core.rb index 43f22d3b4..f16976e78 100644 --- a/lib/aruba/api/core.rb +++ b/lib/aruba/api/core.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rspec/expectations" require "aruba/runtime" require "aruba/errors" diff --git a/lib/aruba/api/environment.rb b/lib/aruba/api/environment.rb index 25c638263..42bf28bc8 100644 --- a/lib/aruba/api/environment.rb +++ b/lib/aruba/api/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/platform" # Aruba diff --git a/lib/aruba/api/filesystem.rb b/lib/aruba/api/filesystem.rb index 697c03d0a..4f2593be3 100644 --- a/lib/aruba/api/filesystem.rb +++ b/lib/aruba/api/filesystem.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "pathname" require "aruba/platform" diff --git a/lib/aruba/api/text.rb b/lib/aruba/api/text.rb index da600d59f..9aa837578 100644 --- a/lib/aruba/api/text.rb +++ b/lib/aruba/api/text.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Api diff --git a/lib/aruba/aruba_logger.rb b/lib/aruba/aruba_logger.rb index 0fe190c3b..4cc792ba8 100644 --- a/lib/aruba/aruba_logger.rb +++ b/lib/aruba/aruba_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "logger" # Aruba diff --git a/lib/aruba/aruba_path.rb b/lib/aruba/aruba_path.rb index 40fb52787..d32af22de 100644 --- a/lib/aruba/aruba_path.rb +++ b/lib/aruba/aruba_path.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "pathname" # Aruba diff --git a/lib/aruba/basic_configuration.rb b/lib/aruba/basic_configuration.rb index f99a701e7..2f2577412 100644 --- a/lib/aruba/basic_configuration.rb +++ b/lib/aruba/basic_configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "contracts" require "aruba/basic_configuration/option" require "aruba/in_config_wrapper" diff --git a/lib/aruba/basic_configuration/option.rb b/lib/aruba/basic_configuration/option.rb index 2b8b15e53..f5a0b0c28 100644 --- a/lib/aruba/basic_configuration/option.rb +++ b/lib/aruba/basic_configuration/option.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Basic Configuration diff --git a/lib/aruba/cli.rb b/lib/aruba/cli.rb index 975e189dc..241229a35 100644 --- a/lib/aruba/cli.rb +++ b/lib/aruba/cli.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "thor" require "aruba/console" require "aruba/initializer" diff --git a/lib/aruba/colorizer.rb b/lib/aruba/colorizer.rb index fc479c68d..aac758616 100644 --- a/lib/aruba/colorizer.rb +++ b/lib/aruba/colorizer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Simple colorizer class. Only supports the color cyan diff --git a/lib/aruba/command.rb b/lib/aruba/command.rb index 6024af628..e60db47d8 100644 --- a/lib/aruba/command.rb +++ b/lib/aruba/command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "delegate" require "aruba/processes/spawn_process" require "aruba/processes/in_process" diff --git a/lib/aruba/command_monitor.rb b/lib/aruba/command_monitor.rb index ed87e4971..2ac19e5a0 100644 --- a/lib/aruba/command_monitor.rb +++ b/lib/aruba/command_monitor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/errors" # Aruba @@ -96,7 +98,7 @@ def clear def all_stdout registered_commands.each(&:stop) - registered_commands.each_with_object("") { |e, a| a << e.stdout } + registered_commands.map(&:stdout).join end # Get stderr of all commands @@ -106,7 +108,7 @@ def all_stdout def all_stderr registered_commands.each(&:stop) - registered_commands.each_with_object("") { |e, a| a << e.stderr } + registered_commands.map(&:stderr).join end # Get stderr and stdout of all commands diff --git a/lib/aruba/config/jruby.rb b/lib/aruba/config/jruby.rb index dbe4d41b6..86fc597b8 100644 --- a/lib/aruba/config/jruby.rb +++ b/lib/aruba/config/jruby.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rbconfig" # ideas taken from: http://blog.headius.com/2010/03/jruby-startup-time-tips.html diff --git a/lib/aruba/config_wrapper.rb b/lib/aruba/config_wrapper.rb index 361fcbe3d..492bdfd91 100644 --- a/lib/aruba/config_wrapper.rb +++ b/lib/aruba/config_wrapper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Aruba # This wraps the current runtime configuration of aruba. # If an option is changed, it notifies the event queue. diff --git a/lib/aruba/configuration.rb b/lib/aruba/configuration.rb index 7b1a57b26..61f985b49 100644 --- a/lib/aruba/configuration.rb +++ b/lib/aruba/configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "contracts" require "aruba/version" diff --git a/lib/aruba/console.rb b/lib/aruba/console.rb index 3bd200ce5..0f44bcaaf 100644 --- a/lib/aruba/console.rb +++ b/lib/aruba/console.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "irb" require "aruba/api" diff --git a/lib/aruba/console/help.rb b/lib/aruba/console/help.rb index e582182ed..052bf8cc7 100644 --- a/lib/aruba/console/help.rb +++ b/lib/aruba/console/help.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/api" # Aruba diff --git a/lib/aruba/contracts/absolute_path.rb b/lib/aruba/contracts/absolute_path.rb index 4ac6319ab..a72c06382 100644 --- a/lib/aruba/contracts/absolute_path.rb +++ b/lib/aruba/contracts/absolute_path.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/platform" # Aruba diff --git a/lib/aruba/contracts/enum.rb b/lib/aruba/contracts/enum.rb index 4157ab26c..044478334 100644 --- a/lib/aruba/contracts/enum.rb +++ b/lib/aruba/contracts/enum.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "contracts" # Aruba diff --git a/lib/aruba/contracts/is_power_of_two.rb b/lib/aruba/contracts/is_power_of_two.rb index 634857aba..13864ca9b 100644 --- a/lib/aruba/contracts/is_power_of_two.rb +++ b/lib/aruba/contracts/is_power_of_two.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/aruba_path" # Aruba diff --git a/lib/aruba/contracts/relative_path.rb b/lib/aruba/contracts/relative_path.rb index 75713c9e7..034111740 100644 --- a/lib/aruba/contracts/relative_path.rb +++ b/lib/aruba/contracts/relative_path.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/platform" # Aruba diff --git a/lib/aruba/cucumber.rb b/lib/aruba/cucumber.rb index 78a821a9b..e179847f7 100644 --- a/lib/aruba/cucumber.rb +++ b/lib/aruba/cucumber.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/version" require "aruba/api" diff --git a/lib/aruba/cucumber/command.rb b/lib/aruba/cucumber/command.rb index 085cd1993..a06bb2754 100644 --- a/lib/aruba/cucumber/command.rb +++ b/lib/aruba/cucumber/command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/generators/script_file" When(/^I run `([^`]*)`$/) do |cmd| @@ -88,7 +90,7 @@ When "I wait for output/stdout to contain:" do |expected| Timeout.timeout(aruba.config.exit_timeout) do loop do - output = last_command_started.public_send :stdout, wait_for_io: 0 + output = last_command_started.stdout wait_for_io: 0 output = sanitize_text(output) expected = sanitize_text(expected) @@ -103,7 +105,7 @@ When "I wait for output/stdout to contain {string}" do |expected| Timeout.timeout(aruba.config.exit_timeout) do loop do - output = last_command_started.public_send :stdout, wait_for_io: 0 + output = last_command_started.stdout wait_for_io: 0 output = sanitize_text(output) expected = sanitize_text(expected) diff --git a/lib/aruba/cucumber/environment.rb b/lib/aruba/cucumber/environment.rb index 4afeb8b7f..db82fb63b 100644 --- a/lib/aruba/cucumber/environment.rb +++ b/lib/aruba/cucumber/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Given(/^a mocked home directory$/) do set_environment_variable "HOME", expand_path(".") end diff --git a/lib/aruba/cucumber/file.rb b/lib/aruba/cucumber/file.rb index 22a667c43..cf0d6be3c 100644 --- a/lib/aruba/cucumber/file.rb +++ b/lib/aruba/cucumber/file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Given(/^I use (?:a|the) fixture(?: named)? "([^"]*)"$/) do |name| copy File.join(aruba.config.fixtures_path_prefix, name), name cd name diff --git a/lib/aruba/cucumber/hooks.rb b/lib/aruba/cucumber/hooks.rb index fd6dea551..54f5eb804 100644 --- a/lib/aruba/cucumber/hooks.rb +++ b/lib/aruba/cucumber/hooks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/aruba_path" require "aruba/api" require "aruba/platform" diff --git a/lib/aruba/cucumber/parameter_types.rb b/lib/aruba/cucumber/parameter_types.rb index d744d7ad0..e11ff543b 100644 --- a/lib/aruba/cucumber/parameter_types.rb +++ b/lib/aruba/cucumber/parameter_types.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + ParameterType(name: "channel", regexp: "output|stderr|stdout", transformer: ->(name) { name }) diff --git a/lib/aruba/cucumber/testing_frameworks.rb b/lib/aruba/cucumber/testing_frameworks.rb index eb1493e29..ded7cd1a5 100644 --- a/lib/aruba/cucumber/testing_frameworks.rb +++ b/lib/aruba/cucumber/testing_frameworks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Cucumber Then(/^the feature(?:s)? should not(?: all)? pass$/) do step 'the output should contain " failed)"' diff --git a/lib/aruba/errors.rb b/lib/aruba/errors.rb index c0043e9e3..04d059003 100644 --- a/lib/aruba/errors.rb +++ b/lib/aruba/errors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Aruba # Standard error class Error < StandardError; end diff --git a/lib/aruba/event_bus.rb b/lib/aruba/event_bus.rb index 219fa20b6..b6ed34b59 100644 --- a/lib/aruba/event_bus.rb +++ b/lib/aruba/event_bus.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/event_bus/name_resolver" require "aruba/errors" diff --git a/lib/aruba/event_bus/name_resolver.rb b/lib/aruba/event_bus/name_resolver.rb index 4c3ba386b..5c6966058 100644 --- a/lib/aruba/event_bus/name_resolver.rb +++ b/lib/aruba/event_bus/name_resolver.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/errors" # Event notification library diff --git a/lib/aruba/events.rb b/lib/aruba/events.rb index 123465195..903644875 100644 --- a/lib/aruba/events.rb +++ b/lib/aruba/events.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Events diff --git a/lib/aruba/file_size.rb b/lib/aruba/file_size.rb index 39ee32bd3..5b0a7f7e4 100644 --- a/lib/aruba/file_size.rb +++ b/lib/aruba/file_size.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "delegate" # Aruba diff --git a/lib/aruba/generators/script_file.rb b/lib/aruba/generators/script_file.rb index ccc36a3fe..3c4cc5bb1 100644 --- a/lib/aruba/generators/script_file.rb +++ b/lib/aruba/generators/script_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Generate script files on command line diff --git a/lib/aruba/hooks.rb b/lib/aruba/hooks.rb index dc07fa3da..9e34b8538 100644 --- a/lib/aruba/hooks.rb +++ b/lib/aruba/hooks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Aruba Hooks diff --git a/lib/aruba/in_config_wrapper.rb b/lib/aruba/in_config_wrapper.rb index b13db5d9f..49b447473 100644 --- a/lib/aruba/in_config_wrapper.rb +++ b/lib/aruba/in_config_wrapper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # In config wrapper diff --git a/lib/aruba/initializer.rb b/lib/aruba/initializer.rb index b175499eb..1a816e493 100644 --- a/lib/aruba/initializer.rb +++ b/lib/aruba/initializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "thor/group" require "thor/actions" diff --git a/lib/aruba/matchers/base/message_indenter.rb b/lib/aruba/matchers/base/message_indenter.rb index 623df5f09..91dd50731 100644 --- a/lib/aruba/matchers/base/message_indenter.rb +++ b/lib/aruba/matchers/base/message_indenter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Aruba module Matchers module Base diff --git a/lib/aruba/matchers/command.rb b/lib/aruba/matchers/command.rb index c7d017afc..0ce27b869 100644 --- a/lib/aruba/matchers/command.rb +++ b/lib/aruba/matchers/command.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Aruba.platform.require_matching_files("../command/**/*.rb", __FILE__) diff --git a/lib/aruba/matchers/command/be_successfully_executed.rb b/lib/aruba/matchers/command/be_successfully_executed.rb index 9a27970ab..f746dd59b 100644 --- a/lib/aruba/matchers/command/be_successfully_executed.rb +++ b/lib/aruba/matchers/command/be_successfully_executed.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/matchers/command/have_exit_status" require "aruba/matchers/command/have_finished_in_time" diff --git a/lib/aruba/matchers/command/have_exit_status.rb b/lib/aruba/matchers/command/have_exit_status.rb index d3ff196c2..c7c206b90 100644 --- a/lib/aruba/matchers/command/have_exit_status.rb +++ b/lib/aruba/matchers/command/have_exit_status.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method have_exit_status(status) # This matchers checks if has exit status # diff --git a/lib/aruba/matchers/command/have_finished_in_time.rb b/lib/aruba/matchers/command/have_finished_in_time.rb index 5c4639e7a..efcad090d 100644 --- a/lib/aruba/matchers/command/have_finished_in_time.rb +++ b/lib/aruba/matchers/command/have_finished_in_time.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method run_too_long # This matchers checks if run too long. Say the timeout is 10 # seconds and it takes to finish in 15. This matchers will succeed. diff --git a/lib/aruba/matchers/command/have_output.rb b/lib/aruba/matchers/command/have_output.rb index 21e6a23d8..f6cdf70e6 100644 --- a/lib/aruba/matchers/command/have_output.rb +++ b/lib/aruba/matchers/command/have_output.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/matchers/base/message_indenter" # @!method have_output diff --git a/lib/aruba/matchers/command/have_output_on_stderr.rb b/lib/aruba/matchers/command/have_output_on_stderr.rb index 955808bfa..fc0cde75e 100644 --- a/lib/aruba/matchers/command/have_output_on_stderr.rb +++ b/lib/aruba/matchers/command/have_output_on_stderr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method have_output_on_stderr # This matchers checks if has created output on stderr # diff --git a/lib/aruba/matchers/command/have_output_on_stdout.rb b/lib/aruba/matchers/command/have_output_on_stdout.rb index 30c6206b9..d8108cb8e 100644 --- a/lib/aruba/matchers/command/have_output_on_stdout.rb +++ b/lib/aruba/matchers/command/have_output_on_stdout.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method have_output_on_stdout # This matchers checks if has created output on stdout # diff --git a/lib/aruba/matchers/command/have_output_size.rb b/lib/aruba/matchers/command/have_output_size.rb index 528ca5fe3..efc30b721 100644 --- a/lib/aruba/matchers/command/have_output_size.rb +++ b/lib/aruba/matchers/command/have_output_size.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method have_output_size(output) # This matchers checks if output has size. # diff --git a/lib/aruba/matchers/directory.rb b/lib/aruba/matchers/directory.rb index 141e0d1c4..82c93eb37 100644 --- a/lib/aruba/matchers/directory.rb +++ b/lib/aruba/matchers/directory.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Aruba.platform.require_matching_files("../directory/**/*.rb", __FILE__) diff --git a/lib/aruba/matchers/directory/be_an_existing_directory.rb b/lib/aruba/matchers/directory/be_an_existing_directory.rb index 470f952eb..a7ba61c8b 100644 --- a/lib/aruba/matchers/directory/be_an_existing_directory.rb +++ b/lib/aruba/matchers/directory/be_an_existing_directory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method be_an_existing_directory # This matchers checks if exists in filesystem # diff --git a/lib/aruba/matchers/directory/have_sub_directory.rb b/lib/aruba/matchers/directory/have_sub_directory.rb index 11edad7bf..2c8f0b544 100644 --- a/lib/aruba/matchers/directory/have_sub_directory.rb +++ b/lib/aruba/matchers/directory/have_sub_directory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method have_sub_directory(sub_directory) # This matchers checks if has given sub-directory # diff --git a/lib/aruba/matchers/environment.rb b/lib/aruba/matchers/environment.rb index 9b0aa5199..78e9c7626 100644 --- a/lib/aruba/matchers/environment.rb +++ b/lib/aruba/matchers/environment.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Aruba.platform.require_matching_files("../matchers/environment/*.rb", __FILE__) diff --git a/lib/aruba/matchers/file.rb b/lib/aruba/matchers/file.rb index 4fcba032d..b92a6a101 100644 --- a/lib/aruba/matchers/file.rb +++ b/lib/aruba/matchers/file.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Aruba.platform.require_matching_files("../file/**/*.rb", __FILE__) diff --git a/lib/aruba/matchers/file/be_a_command_found_in_path.rb b/lib/aruba/matchers/file/be_a_command_found_in_path.rb index 91d2b2219..2896af961 100644 --- a/lib/aruba/matchers/file/be_a_command_found_in_path.rb +++ b/lib/aruba/matchers/file/be_a_command_found_in_path.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method be_a_command_found_in_path # This matchers checks if can be found in path # diff --git a/lib/aruba/matchers/file/be_an_existing_executable.rb b/lib/aruba/matchers/file/be_an_existing_executable.rb index f7c926ac0..94ad408ec 100644 --- a/lib/aruba/matchers/file/be_an_existing_executable.rb +++ b/lib/aruba/matchers/file/be_an_existing_executable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "shellwords" # @!method be_an_existing_executable diff --git a/lib/aruba/matchers/file/be_an_existing_file.rb b/lib/aruba/matchers/file/be_an_existing_file.rb index e94b8a9da..406a6589e 100644 --- a/lib/aruba/matchers/file/be_an_existing_file.rb +++ b/lib/aruba/matchers/file/be_an_existing_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method be_an_existing_file # This matchers checks if exists in filesystem # diff --git a/lib/aruba/matchers/file/have_file_content.rb b/lib/aruba/matchers/file/have_file_content.rb index d0dd4657f..36d152f73 100644 --- a/lib/aruba/matchers/file/have_file_content.rb +++ b/lib/aruba/matchers/file/have_file_content.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method have_file_content(content) # This matchers checks if has content. `content` can be a string, # regexp or an RSpec matcher. diff --git a/lib/aruba/matchers/file/have_file_size.rb b/lib/aruba/matchers/file/have_file_size.rb index 18ff69a64..0d926498b 100644 --- a/lib/aruba/matchers/file/have_file_size.rb +++ b/lib/aruba/matchers/file/have_file_size.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method have_file_size(size) # This matchers checks if path has file size # diff --git a/lib/aruba/matchers/file/have_same_file_content.rb b/lib/aruba/matchers/file/have_same_file_content.rb index deae016d4..ebbca9989 100644 --- a/lib/aruba/matchers/file/have_same_file_content.rb +++ b/lib/aruba/matchers/file/have_same_file_content.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "fileutils" # @!method have_same_file_content_as(file_name) diff --git a/lib/aruba/matchers/path.rb b/lib/aruba/matchers/path.rb index e7dc79b08..1ca38942c 100644 --- a/lib/aruba/matchers/path.rb +++ b/lib/aruba/matchers/path.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Aruba.platform.require_matching_files("../path/**/*.rb", __FILE__) diff --git a/lib/aruba/matchers/path/a_path_matching_pattern.rb b/lib/aruba/matchers/path/a_path_matching_pattern.rb index c2fb0a781..21d95f2b9 100644 --- a/lib/aruba/matchers/path/a_path_matching_pattern.rb +++ b/lib/aruba/matchers/path/a_path_matching_pattern.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method a_path_matching_pattern(/pattern/) # This matchers checks if matches pattern. `pattern` can be a string, # regexp or an RSpec matcher. diff --git a/lib/aruba/matchers/path/be_an_absolute_path.rb b/lib/aruba/matchers/path/be_an_absolute_path.rb index da8dd291e..d31374ba0 100644 --- a/lib/aruba/matchers/path/be_an_absolute_path.rb +++ b/lib/aruba/matchers/path/be_an_absolute_path.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method be_an_absolute_path # This matchers checks if exists in filesystem # diff --git a/lib/aruba/matchers/path/be_an_existing_path.rb b/lib/aruba/matchers/path/be_an_existing_path.rb index b455b1fd4..2c7cae3b7 100644 --- a/lib/aruba/matchers/path/be_an_existing_path.rb +++ b/lib/aruba/matchers/path/be_an_existing_path.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method be_an_existing_path # This matchers checks if exists in filesystem # diff --git a/lib/aruba/matchers/path/have_permissions.rb b/lib/aruba/matchers/path/have_permissions.rb index 887cc700e..b4a14f6ec 100644 --- a/lib/aruba/matchers/path/have_permissions.rb +++ b/lib/aruba/matchers/path/have_permissions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method have_permissions(permissions) # This matchers checks if or has permissions # diff --git a/lib/aruba/matchers/string.rb b/lib/aruba/matchers/string.rb index dc6e05da7..b5444ac82 100644 --- a/lib/aruba/matchers/string.rb +++ b/lib/aruba/matchers/string.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + Aruba.platform.require_matching_files("../string/**/*.rb", __FILE__) diff --git a/lib/aruba/matchers/string/include_output_string.rb b/lib/aruba/matchers/string/include_output_string.rb index 18746bce0..245774e6c 100644 --- a/lib/aruba/matchers/string/include_output_string.rb +++ b/lib/aruba/matchers/string/include_output_string.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method include_output_string(string) # This matchers checks if the output string of a command includes string. # diff --git a/lib/aruba/matchers/string/match_output_string.rb b/lib/aruba/matchers/string/match_output_string.rb index 221cbf6d6..1f45aa081 100644 --- a/lib/aruba/matchers/string/match_output_string.rb +++ b/lib/aruba/matchers/string/match_output_string.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method match_output_string(string) # This matchers checks if the output string of a command matches regular expression. # diff --git a/lib/aruba/matchers/string/output_string_eq.rb b/lib/aruba/matchers/string/output_string_eq.rb index 802dbbaab..dc0e44c43 100644 --- a/lib/aruba/matchers/string/output_string_eq.rb +++ b/lib/aruba/matchers/string/output_string_eq.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # @!method output_string_eq(string) # This matchers checks if the output string of a command includes string. # diff --git a/lib/aruba/platform.rb b/lib/aruba/platform.rb index 35c550652..f6600fbe0 100644 --- a/lib/aruba/platform.rb +++ b/lib/aruba/platform.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/platforms/unix_platform" require "aruba/platforms/windows_platform" diff --git a/lib/aruba/platforms/announcer.rb b/lib/aruba/platforms/announcer.rb index d6b061235..2968263f9 100644 --- a/lib/aruba/platforms/announcer.rb +++ b/lib/aruba/platforms/announcer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "shellwords" require "aruba/colorizer" diff --git a/lib/aruba/platforms/aruba_file_creator.rb b/lib/aruba/platforms/aruba_file_creator.rb index 845e2b532..e4c4f6dee 100644 --- a/lib/aruba/platforms/aruba_file_creator.rb +++ b/lib/aruba/platforms/aruba_file_creator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Platforms diff --git a/lib/aruba/platforms/aruba_fixed_size_file_creator.rb b/lib/aruba/platforms/aruba_fixed_size_file_creator.rb index 37e725c04..6117da083 100644 --- a/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +++ b/lib/aruba/platforms/aruba_fixed_size_file_creator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Platforms diff --git a/lib/aruba/platforms/determine_disk_usage.rb b/lib/aruba/platforms/determine_disk_usage.rb index c5ff99251..ca501e75b 100644 --- a/lib/aruba/platforms/determine_disk_usage.rb +++ b/lib/aruba/platforms/determine_disk_usage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/file_size" module Aruba diff --git a/lib/aruba/platforms/determine_file_size.rb b/lib/aruba/platforms/determine_file_size.rb index e9d2c63bc..53027d155 100644 --- a/lib/aruba/platforms/determine_file_size.rb +++ b/lib/aruba/platforms/determine_file_size.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Platforms diff --git a/lib/aruba/platforms/filesystem_status.rb b/lib/aruba/platforms/filesystem_status.rb index 6a6bfddc6..bbc8a9f9d 100644 --- a/lib/aruba/platforms/filesystem_status.rb +++ b/lib/aruba/platforms/filesystem_status.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Aruba module Platforms # File System Status object diff --git a/lib/aruba/platforms/local_environment.rb b/lib/aruba/platforms/local_environment.rb index 2f5403289..76cdcd229 100644 --- a/lib/aruba/platforms/local_environment.rb +++ b/lib/aruba/platforms/local_environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Platforms diff --git a/lib/aruba/platforms/simple_table.rb b/lib/aruba/platforms/simple_table.rb index 4650658ba..ffe3c921c 100644 --- a/lib/aruba/platforms/simple_table.rb +++ b/lib/aruba/platforms/simple_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Platforms diff --git a/lib/aruba/platforms/unix_command_string.rb b/lib/aruba/platforms/unix_command_string.rb index 6a6d198cf..8f2fdec48 100644 --- a/lib/aruba/platforms/unix_command_string.rb +++ b/lib/aruba/platforms/unix_command_string.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "delegate" require "shellwords" diff --git a/lib/aruba/platforms/unix_environment_variables.rb b/lib/aruba/platforms/unix_environment_variables.rb index 25a54f507..0d5ed4c37 100644 --- a/lib/aruba/platforms/unix_environment_variables.rb +++ b/lib/aruba/platforms/unix_environment_variables.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Platforms diff --git a/lib/aruba/platforms/unix_platform.rb b/lib/aruba/platforms/unix_platform.rb index 11881c802..03709215c 100644 --- a/lib/aruba/platforms/unix_platform.rb +++ b/lib/aruba/platforms/unix_platform.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rbconfig" require "rubygems" require "pathname" diff --git a/lib/aruba/platforms/unix_which.rb b/lib/aruba/platforms/unix_which.rb index 0c1de102c..10c298b58 100644 --- a/lib/aruba/platforms/unix_which.rb +++ b/lib/aruba/platforms/unix_which.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Platforms diff --git a/lib/aruba/platforms/windows_command_string.rb b/lib/aruba/platforms/windows_command_string.rb index 0a90f5ceb..316d04b6a 100644 --- a/lib/aruba/platforms/windows_command_string.rb +++ b/lib/aruba/platforms/windows_command_string.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Platforms diff --git a/lib/aruba/platforms/windows_environment_variables.rb b/lib/aruba/platforms/windows_environment_variables.rb index be3af2c35..ffcfe74f9 100644 --- a/lib/aruba/platforms/windows_environment_variables.rb +++ b/lib/aruba/platforms/windows_environment_variables.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/platforms/unix_environment_variables" # Aruba diff --git a/lib/aruba/platforms/windows_platform.rb b/lib/aruba/platforms/windows_platform.rb index c4c85f268..e4cb0d87c 100644 --- a/lib/aruba/platforms/windows_platform.rb +++ b/lib/aruba/platforms/windows_platform.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/platforms/unix_platform" require "aruba/platforms/windows_command_string" require "aruba/platforms/windows_environment_variables" diff --git a/lib/aruba/platforms/windows_which.rb b/lib/aruba/platforms/windows_which.rb index 5d6688a0a..6d9fa4545 100644 --- a/lib/aruba/platforms/windows_which.rb +++ b/lib/aruba/platforms/windows_which.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Aruba module Aruba # Platforms diff --git a/lib/aruba/processes/basic_process.rb b/lib/aruba/processes/basic_process.rb index 148095f16..2a6d1a756 100644 --- a/lib/aruba/processes/basic_process.rb +++ b/lib/aruba/processes/basic_process.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/platform" require "shellwords" diff --git a/lib/aruba/processes/debug_process.rb b/lib/aruba/processes/debug_process.rb index 5a14130d2..5d28d7dde 100644 --- a/lib/aruba/processes/debug_process.rb +++ b/lib/aruba/processes/debug_process.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/processes/spawn_process" # Aruba diff --git a/lib/aruba/processes/in_process.rb b/lib/aruba/processes/in_process.rb index 96c332e65..4d63fb432 100644 --- a/lib/aruba/processes/in_process.rb +++ b/lib/aruba/processes/in_process.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "shellwords" require "stringio" require "aruba/processes/basic_process" diff --git a/lib/aruba/processes/spawn_process.rb b/lib/aruba/processes/spawn_process.rb index db807f481..88f4c207f 100644 --- a/lib/aruba/processes/spawn_process.rb +++ b/lib/aruba/processes/spawn_process.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tempfile" require "shellwords" diff --git a/lib/aruba/rspec.rb b/lib/aruba/rspec.rb index 7ab2200a2..198733b0a 100644 --- a/lib/aruba/rspec.rb +++ b/lib/aruba/rspec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rspec/core" require "aruba" diff --git a/lib/aruba/runtime.rb b/lib/aruba/runtime.rb index 78358e8a1..d975a93ee 100644 --- a/lib/aruba/runtime.rb +++ b/lib/aruba/runtime.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/configuration" require "aruba/aruba_path" require "aruba/config_wrapper" diff --git a/lib/aruba/setup.rb b/lib/aruba/setup.rb index 720d071f2..2b3eebbed 100644 --- a/lib/aruba/setup.rb +++ b/lib/aruba/setup.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Aruba class Setup private diff --git a/lib/aruba/version.rb b/lib/aruba/version.rb index 5a7628961..5d0dd697f 100644 --- a/lib/aruba/version.rb +++ b/lib/aruba/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Aruba - VERSION = "2.2.0".freeze + VERSION = "2.2.0" end diff --git a/spec/aruba/api/bundler_spec.rb b/spec/aruba/api/bundler_spec.rb index 46ac3d741..81d4a8dd5 100644 --- a/spec/aruba/api/bundler_spec.rb +++ b/spec/aruba/api/bundler_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/api" diff --git a/spec/aruba/api/commands_spec.rb b/spec/aruba/api/commands_spec.rb index 06c9f7776..07828a6d4 100644 --- a/spec/aruba/api/commands_spec.rb +++ b/spec/aruba/api/commands_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/api" require "fileutils" @@ -11,15 +13,17 @@ after { @aruba.all_commands.each(&:stop) } - it "respond to input" do - @aruba.type "Hello" - @aruba.type "\u0004" + it "respond to unfrozen input" do + @aruba.type(+"Hello") + @aruba.type(+"\u0004") + expect(@aruba.last_command_started).to have_output "Hello" end it "respond to frozen input" do - @aruba.type "Hello".freeze - @aruba.type "\u0004".freeze + @aruba.type "Hello" + @aruba.type "\u0004" + expect(@aruba.last_command_started).to have_output "Hello" end diff --git a/spec/aruba/api/core_spec.rb b/spec/aruba/api/core_spec.rb index 1e8df29f7..b3a3a6eb9 100644 --- a/spec/aruba/api/core_spec.rb +++ b/spec/aruba/api/core_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/api" require "fileutils" diff --git a/spec/aruba/api/filesystem_spec.rb b/spec/aruba/api/filesystem_spec.rb index 88cc626db..b00600b6f 100644 --- a/spec/aruba/api/filesystem_spec.rb +++ b/spec/aruba/api/filesystem_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/api" diff --git a/spec/aruba/api/runtime_spec.rb b/spec/aruba/api/runtime_spec.rb index 222e85e7b..70a86e84e 100644 --- a/spec/aruba/api/runtime_spec.rb +++ b/spec/aruba/api/runtime_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe "aruba" do diff --git a/spec/aruba/api_spec.rb b/spec/aruba/api_spec.rb index 2455fe44a..4efd47bde 100644 --- a/spec/aruba/api_spec.rb +++ b/spec/aruba/api_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/api" require "fileutils" diff --git a/spec/aruba/aruba_path_spec.rb b/spec/aruba/aruba_path_spec.rb index e73788861..dc604199a 100644 --- a/spec/aruba/aruba_path_spec.rb +++ b/spec/aruba/aruba_path_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/aruba_path" diff --git a/spec/aruba/basic_configuration_spec.rb b/spec/aruba/basic_configuration_spec.rb index 871057da3..1f9f3a0a8 100644 --- a/spec/aruba/basic_configuration_spec.rb +++ b/spec/aruba/basic_configuration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::BasicConfiguration do diff --git a/spec/aruba/command_monitor_spec.rb b/spec/aruba/command_monitor_spec.rb index b08ca8e5b..ffd91f0de 100644 --- a/spec/aruba/command_monitor_spec.rb +++ b/spec/aruba/command_monitor_spec.rb @@ -1,21 +1,54 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::CommandMonitor do let(:monitor) { described_class.new(announcer: announcer) } let(:announcer) { instance_double(Aruba::Platforms::Announcer) } - let(:process) { instance_double(Aruba::Processes::BasicProcess, commandline: "foobar") } + let(:foo_process) do + instance_double(Aruba::Processes::InProcess, commandline: "foo", + stop: nil, + stdout: "foo_stdout\n", + stderr: "foo_stderr\n") + end + let(:bar_process) do + instance_double(Aruba::Processes::InProcess, commandline: "bar", + stop: nil, + stdout: "bar_stdout\n", + stderr: "bar_stderr\n") + end before do - monitor.register_command(process) + monitor.register_command(foo_process) + monitor.register_command(bar_process) end describe "#find" do it "find the process with the given name" do - expect(monitor.find("foobar")).to eq process + expect(monitor.find("foo")).to eq foo_process end it "fails if no process with the given name exists" do expect { monitor.find("boofar") }.to raise_error Aruba::CommandNotFoundError end end + + describe "#all_stdout" do + it "combines stdout from all registered processs" do + expect(monitor.all_stdout).to eq "foo_stdout\nbar_stdout\n" + end + end + + describe "#all_stderr" do + it "combines stderr from all registered processs" do + expect(monitor.all_stderr).to eq "foo_stderr\nbar_stderr\n" + end + end + + describe "#all_output" do + it "combines stdout and stderr from all registered processs" do + expect(monitor.all_output) + .to eq "foo_stdout\nbar_stdout\nfoo_stderr\nbar_stderr\n" + end + end end diff --git a/spec/aruba/command_spec.rb b/spec/aruba/command_spec.rb index 8df16af92..cb3c90ee1 100644 --- a/spec/aruba/command_spec.rb +++ b/spec/aruba/command_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::Command do diff --git a/spec/aruba/configuration_spec.rb b/spec/aruba/configuration_spec.rb index 35e208976..da91bcd9e 100644 --- a/spec/aruba/configuration_spec.rb +++ b/spec/aruba/configuration_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::Configuration do diff --git a/spec/aruba/event_bus/name_resolver_spec.rb b/spec/aruba/event_bus/name_resolver_spec.rb index e81cfc14b..6fedf6512 100644 --- a/spec/aruba/event_bus/name_resolver_spec.rb +++ b/spec/aruba/event_bus/name_resolver_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe Aruba::EventBus::NameResolver do diff --git a/spec/aruba/event_bus_spec.rb b/spec/aruba/event_bus_spec.rb index fce01b72d..799c5bfc0 100644 --- a/spec/aruba/event_bus_spec.rb +++ b/spec/aruba/event_bus_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe Aruba::EventBus do diff --git a/spec/aruba/hooks_spec.rb b/spec/aruba/hooks_spec.rb index 39f5da7d8..8d5e13a61 100644 --- a/spec/aruba/hooks_spec.rb +++ b/spec/aruba/hooks_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe Aruba::Hooks do diff --git a/spec/aruba/in_config_wrapper_spec.rb b/spec/aruba/in_config_wrapper_spec.rb index c4ea95777..ccf6b868e 100644 --- a/spec/aruba/in_config_wrapper_spec.rb +++ b/spec/aruba/in_config_wrapper_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::InConfigWrapper do diff --git a/spec/aruba/jruby_spec.rb b/spec/aruba/jruby_spec.rb index 414dbb9c1..d71c1d6f3 100644 --- a/spec/aruba/jruby_spec.rb +++ b/spec/aruba/jruby_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/api" diff --git a/spec/aruba/matchers/command/have_output_size_spec.rb b/spec/aruba/matchers/command/have_output_size_spec.rb index d0adfda00..0ee6fa3d9 100644 --- a/spec/aruba/matchers/command/have_output_size_spec.rb +++ b/spec/aruba/matchers/command/have_output_size_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe "Output Matchers" do diff --git a/spec/aruba/matchers/command_spec.rb b/spec/aruba/matchers/command_spec.rb index 4083d1fab..51275177a 100644 --- a/spec/aruba/matchers/command_spec.rb +++ b/spec/aruba/matchers/command_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe "Command Matchers" do diff --git a/spec/aruba/matchers/directory_spec.rb b/spec/aruba/matchers/directory_spec.rb index 729831783..b61d16bff 100644 --- a/spec/aruba/matchers/directory_spec.rb +++ b/spec/aruba/matchers/directory_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/matchers/directory" require "fileutils" diff --git a/spec/aruba/matchers/file_spec.rb b/spec/aruba/matchers/file_spec.rb index 6e003b508..d1e9a4221 100644 --- a/spec/aruba/matchers/file_spec.rb +++ b/spec/aruba/matchers/file_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/matchers/file" diff --git a/spec/aruba/matchers/path_spec.rb b/spec/aruba/matchers/path_spec.rb index d463395d0..5898faa2b 100644 --- a/spec/aruba/matchers/path_spec.rb +++ b/spec/aruba/matchers/path_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "fileutils" diff --git a/spec/aruba/platforms/announcer_spec.rb b/spec/aruba/platforms/announcer_spec.rb index 7ea45cea9..84db39814 100644 --- a/spec/aruba/platforms/announcer_spec.rb +++ b/spec/aruba/platforms/announcer_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/platforms/announcer" diff --git a/spec/aruba/platforms/simple_table_spec.rb b/spec/aruba/platforms/simple_table_spec.rb index a33210255..e9ca67c7e 100644 --- a/spec/aruba/platforms/simple_table_spec.rb +++ b/spec/aruba/platforms/simple_table_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/platform" diff --git a/spec/aruba/platforms/unix_command_string_spec.rb b/spec/aruba/platforms/unix_command_string_spec.rb index 7475b43eb..ee5bdb177 100644 --- a/spec/aruba/platforms/unix_command_string_spec.rb +++ b/spec/aruba/platforms/unix_command_string_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::Platforms::UnixCommandString do diff --git a/spec/aruba/platforms/unix_platform_spec.rb b/spec/aruba/platforms/unix_platform_spec.rb index 75718f726..53e74c2df 100644 --- a/spec/aruba/platforms/unix_platform_spec.rb +++ b/spec/aruba/platforms/unix_platform_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/platforms/unix_platform" diff --git a/spec/aruba/platforms/windows_command_string_spec.rb b/spec/aruba/platforms/windows_command_string_spec.rb index 07f52b781..582d6beea 100644 --- a/spec/aruba/platforms/windows_command_string_spec.rb +++ b/spec/aruba/platforms/windows_command_string_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::Platforms::WindowsCommandString do diff --git a/spec/aruba/platforms/windows_environment_variables_spec.rb b/spec/aruba/platforms/windows_environment_variables_spec.rb index c7868358e..7baa2b3d8 100644 --- a/spec/aruba/platforms/windows_environment_variables_spec.rb +++ b/spec/aruba/platforms/windows_environment_variables_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/platforms/windows_environment_variables" diff --git a/spec/aruba/platforms/windows_platform_spec.rb b/spec/aruba/platforms/windows_platform_spec.rb index 5ae02e8ab..699eac35b 100644 --- a/spec/aruba/platforms/windows_platform_spec.rb +++ b/spec/aruba/platforms/windows_platform_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" require "aruba/platforms/windows_platform" diff --git a/spec/aruba/processes/basic_process_spec.rb b/spec/aruba/processes/basic_process_spec.rb index 0311c0092..dcc6637b6 100644 --- a/spec/aruba/processes/basic_process_spec.rb +++ b/spec/aruba/processes/basic_process_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::Processes::BasicProcess do @@ -6,7 +8,7 @@ def initialize(*args) @stdout = args.shift @stderr = args.shift - super(*args) + super end def stdout(*_args) diff --git a/spec/aruba/processes/in_process_spec.rb b/spec/aruba/processes/in_process_spec.rb index ca275084d..dd87e9144 100644 --- a/spec/aruba/processes/in_process_spec.rb +++ b/spec/aruba/processes/in_process_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::Processes::InProcess do diff --git a/spec/aruba/processes/spawn_process_spec.rb b/spec/aruba/processes/spawn_process_spec.rb index a3aa03999..1bcdcb978 100644 --- a/spec/aruba/processes/spawn_process_spec.rb +++ b/spec/aruba/processes/spawn_process_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::Processes::SpawnProcess do diff --git a/spec/aruba/rspec_spec.rb b/spec/aruba/rspec_spec.rb index 4db4ff1d0..078a53335 100644 --- a/spec/aruba/rspec_spec.rb +++ b/spec/aruba/rspec_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe "RSpec Integration", type: :aruba do diff --git a/spec/aruba/runtime_spec.rb b/spec/aruba/runtime_spec.rb index 43b1303f9..f3c46497c 100644 --- a/spec/aruba/runtime_spec.rb +++ b/spec/aruba/runtime_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" RSpec.describe Aruba::Runtime do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bf0b5fdde..7156b79fe 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH << File.expand_path("../lib", __dir__) unless RUBY_PLATFORM.include?("java") diff --git a/spec/support/configs/aruba.rb b/spec/support/configs/aruba.rb index 83175bb45..b1c207f72 100644 --- a/spec/support/configs/aruba.rb +++ b/spec/support/configs/aruba.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "aruba/rspec" require "aruba/config/jruby" diff --git a/spec/support/configs/pry.rb b/spec/support/configs/pry.rb index bd4895bbf..f460211a8 100644 --- a/spec/support/configs/pry.rb +++ b/spec/support/configs/pry.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Otherwise pry doesn't find it's RC file # if ENV['HOME'] is mocked ENV["PRYRC"] = File.expand_path("~/.pryrc") diff --git a/spec/support/configs/rspec.rb b/spec/support/configs/rspec.rb index 8014aa1c4..eb4188c66 100644 --- a/spec/support/configs/rspec.rb +++ b/spec/support/configs/rspec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rspec/core" require "aruba/api" diff --git a/spec/support/helpers/reporting.rb b/spec/support/helpers/reporting.rb index 3788635ba..23d57c118 100644 --- a/spec/support/helpers/reporting.rb +++ b/spec/support/helpers/reporting.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SpecHelpers module Reporting # Captures the given stream and returns it: diff --git a/spec/support/shared_contexts/aruba.rb b/spec/support/shared_contexts/aruba.rb index d7889547b..b321c322f 100644 --- a/spec/support/shared_contexts/aruba.rb +++ b/spec/support/shared_contexts/aruba.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "fileutils" require "securerandom" diff --git a/spec/support/shared_examples/configuration.rb b/spec/support/shared_examples/configuration.rb index 6cad2fc91..dab801f50 100644 --- a/spec/support/shared_examples/configuration.rb +++ b/spec/support/shared_examples/configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.shared_examples "a basic configuration" do subject(:config) do Class.new(described_class) do