Module: MinispecMetadata::Tags

Defined in:
lib/minispec-metadata/tags.rb

Instance Method Summary collapse

Instance Method Details

#runnable_method_matches_any_exclusive_tag?(runnable_method) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
55
# File 'lib/minispec-metadata/tags.rb', line 52

def runnable_method_matches_any_exclusive_tag?(runnable_method)
  tags = .tags.select(&:exclusive?)
  runnable_method_matches_any_tags?(runnable_method, tags)
end

#runnable_method_matches_any_inclusive_tag?(runnable_method) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
50
# File 'lib/minispec-metadata/tags.rb', line 47

def runnable_method_matches_any_inclusive_tag?(runnable_method)
  tags = .tags.select(&:inclusive?)
  runnable_method_matches_any_tags?(runnable_method, tags)
end

#runnable_methodsObject



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/minispec-metadata/tags.rb', line 33

def runnable_methods
  methods = super.dup

  if .tags.select(&:inclusive?).any?
    methods.select! do |runnable_method|
      runnable_method_matches_any_inclusive_tag?(runnable_method)
    end
  end

  methods.reject do |runnable_method|
    runnable_method_matches_any_exclusive_tag?(runnable_method)
  end
end