Sha256: e19a598a27254db78b13e246456398785e9719ecd03634d44911a4bb4885617b

Contents?: true

Size: 477 Bytes

Versions: 3

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

module Specimen
  module Command
    class PathRunner < TestRunner
      argument :path, type: :string, default: ''

      no_commands do
        def arg_is_command_option?
          return false if path.empty?

          path.start_with?('--', '-')
        end

        def tests_path
          return @tests_path if @tests_path
          return '' if arg_is_command_option?

          @tests_path = path
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
specimen-0.0.4.alpha lib/specimen/command/runner/path_runner.rb
specimen-0.0.3.alpha lib/specimen/command/runner/path_runner.rb
specimen-0.0.2.alpha lib/specimen/command/runner/path_runner.rb