Class: Taglob::Rake::TagsTask

Inherits:
Object
  • Object
show all
Defined in:
lib/taglob/rake/test_tags_task.rb

Overview

TagsTask will allow you to specify your own TestTagTasks in your Rakefile:

Example : Using Unit Test Framework

require 'taglob/rake'
Taglob::Rake::SpecTagsTask.new :spec_regression do |t|
  t.pattern = 'spec/**/*_spec.rb'
  t.tags = "regression|smoke"
end

Example : Using RSpec Test Framework

require 'taglob/rake'
Taglob::Rake::TestTagsTask.new :test_regression do |t|
  t.pattern = 'test/**/test_*.rb'
  t.tags = "regression|smoke"
end

Direct Known Subclasses

SpecTagsTask, TestTagsTask

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) {|_self| ... } ⇒ TagsTask

Returns a new instance of TagsTask.

Yields:

  • (_self)

Yield Parameters:



27
28
29
30
31
# File 'lib/taglob/rake/test_tags_task.rb', line 27

def initialize(name)
  @name = name
  yield self if block_given?
  define
end

Instance Attribute Details

#patternObject

Returns the value of attribute pattern.



24
25
26
# File 'lib/taglob/rake/test_tags_task.rb', line 24

def pattern
  @pattern
end

#tagsObject

Returns the value of attribute tags.



25
26
27
# File 'lib/taglob/rake/test_tags_task.rb', line 25

def tags
  @tags
end

Instance Method Details

#test_filesObject



33
34
35
# File 'lib/taglob/rake/test_tags_task.rb', line 33

def test_files
  Dir.taglob(pattern,tags) unless tags.nil? || pattern.nil?
end