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)


38
39
40
41
# File 'lib/minispec-metadata/tags.rb', line 38

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) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
# File 'lib/minispec-metadata/tags.rb', line 33

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

#runnable_methodsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/minispec-metadata/tags.rb', line 19

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