module MinispecMetadata::Tags

Public Instance Methods

runnable_method_matches_any_exclusive_tag?(runnable_method) click to toggle source
# File lib/minispec-metadata/tags.rb, line 52
def runnable_method_matches_any_exclusive_tag?(runnable_method)
  tags = MinispecMetadata.tags.select(&:exclusive?)
  runnable_method_matches_any_tags?(runnable_method, tags)
end
runnable_method_matches_any_inclusive_tag?(runnable_method) click to toggle source
# File lib/minispec-metadata/tags.rb, line 47
def runnable_method_matches_any_inclusive_tag?(runnable_method)
  tags = MinispecMetadata.tags.select(&:inclusive?)
  runnable_method_matches_any_tags?(runnable_method, tags)
end
runnable_methods() click to toggle source
Calls superclass method
# File lib/minispec-metadata/tags.rb, line 33
def runnable_methods
  methods = super.dup

  if MinispecMetadata.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

Private Instance Methods

runnable_method_matches_any_tags?(runnable_method, tags) click to toggle source
# File lib/minispec-metadata/tags.rb, line 59
def runnable_method_matches_any_tags?(runnable_method, tags)
  tags.any? do |tag|
    metadata = metadata_for_test_name(runnable_method)
    value = metadata[tag.key] || metadata[tag.key.to_sym]
    matches =
      if tag.value?
        value.to_s == tag.value
      else
        !!value
      end
    matches
  end
end