Class: Anyt::Config

Inherits:
Anyway::Config
  • Object
show all
Defined in:
lib/anyt/config.rb

Overview

Anyt configuration

Instance Method Summary collapse

Instance Method Details

#filter_tests?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/anyt/config.rb', line 27

def filter_tests?
  only_tests || except_tests
end

#tests_filterObject



31
32
33
34
35
36
37
38
39
# File 'lib/anyt/config.rb', line 31

def tests_filter
  only_rxp = /(#{only_tests.join("|")})/ if only_tests
  except_rxp = /(#{except_tests.join("|")})/ if except_tests

  @tests_filter ||= lambda do |path|
    (only_rxp.nil? || only_rxp.match?(path)) &&
      (except_rxp.nil? || !except_rxp.match?(path))
  end
end

#tests_pathObject



21
22
23
24
25
# File 'lib/anyt/config.rb', line 21

def tests_path
  return unless tests_relative_path

  File.expand_path(tests_relative_path, Dir.pwd)
end