lib/retest/command.rb in retest-2.0.0.pre vs lib/retest/command.rb in retest-2.0.0.pre1

- old
+ new

@@ -5,18 +5,14 @@ module Retest class Command extend Forwardable - def self.for_options(options) - new(options: options).command + def self.for_options(options, stdout: $stdout) + new(options: options, stdout: stdout).command end - def self.for_setup(setup) - new(setup: setup).command - end - def_delegator :setup, :type def_delegators :options, :params, :full_suite?, :auto? attr_accessor :options, :setup def initialize(options: Options.new, setup: Setup.new, stdout: $stdout) @@ -49,14 +45,18 @@ else ruby_command end end def default_command - @stdout.puts "Setup identified: [#{type.upcase}]. Using command: '#{setup_command}'" + log "Setup identified: [#{type.upcase}]. Using command: '#{setup_command}'" setup_command end private + + def log(message) + @stdout&.puts(message) + end def rspec_command Rspec.new(all: full_suite?) end \ No newline at end of file