Module: Minitag

Defined in:
lib/minitag.rb,
lib/minitag/context.rb,
lib/minitag/version.rb,
lib/minitag/minitest_tag.rb,
lib/minitag/tag_registry.rb,
lib/minitag/tag_extension.rb,
lib/minitag/extension_registry.rb

Overview

Namespace for classes or modules providing tagging functionality to Minitest::Test

Defined Under Namespace

Modules: MinitestTag, TagExtension Classes: Context, ExtensionRegistry, TagRegistry

Constant Summary collapse

VERSION =
'0.7.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.skip_filtered=(value) ⇒ Object (writeonly)

Sets the attribute skip_filtered

Parameters:

  • value

    the value to set the attribute skip_filtered to.



15
16
17
# File 'lib/minitag.rb', line 15

def skip_filtered=(value)
  @skip_filtered = value
end

Class Method Details

.add_filter(tag) ⇒ Object

Add filtering tag to context specified by the ‘–tag` or `-t` option.



33
34
35
# File 'lib/minitag.rb', line 33

def add_filter(tag)
  context.add_filter(tag)
end

.contextObject

Execution context of the test suite.



28
29
30
# File 'lib/minitag.rb', line 28

def context
  @context ||= Context.new
end

.extension_registryObject

Registry of classes that requires extension by Minitag::TagExtension.



18
19
20
# File 'lib/minitag.rb', line 18

def extension_registry
  @extension_registry ||= ExtensionRegistry.new
end

.pending_tagsObject

Tags from the last ‘tag` method awaiting to be associated with a test.



38
39
40
# File 'lib/minitag.rb', line 38

def pending_tags
  @pending_tags || []
end

.pending_tags=(tags) ⇒ Object

Tags set from the ‘tag` method.



43
44
45
# File 'lib/minitag.rb', line 43

def pending_tags=(tags)
  @pending_tags = Array(tags)
end

.register_for_extension(klass) ⇒ Object

Register a class for extension.



23
24
25
# File 'lib/minitag.rb', line 23

def register_for_extension(klass)
  extension_registry.register(klass)
end

.skip_filtered?Boolean

Whether to skip (true) or hide (false) filtered tests.

Returns:

  • (Boolean)


48
49
50
# File 'lib/minitag.rb', line 48

def skip_filtered?
  @skip_filtered || false
end