Class: Lookout::Rake::Tasks::Test

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/lookout/rake/tasks/test.rb

Constant Summary collapse

LoaderPath =
File.join(File.dirname(__FILE__), 'test/loader.rb')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(specification = Lookout::Rake::Tasks.specification, name = :test) {|_self| ... } ⇒ Test

Returns a new instance of Test.

Yields:

  • (_self)

Yield Parameters:



6
7
8
9
10
# File 'lib/lookout/rake/tasks/test.rb', line 6

def initialize(specification = Lookout::Rake::Tasks.specification, name = :test)
  self.specification, @name = specification, name
  yield self if block_given?
  define
end

Instance Attribute Details

#requiresObject

Returns the value of attribute requires.



21
22
23
# File 'lib/lookout/rake/tasks/test.rb', line 21

def requires
  @requires
end

Instance Method Details

#defineObject



12
13
14
15
16
17
18
19
# File 'lib/lookout/rake/tasks/test.rb', line 12

def define
  desc @name == :test ? 'Run tests' : 'Run tests for %s' % @name
  task @name do
    ruby '-w %s -- %s %s' % [options, escape(LoaderPath), arguments]
  end

  task :default => @name unless Rake::Task.task_defined? :default
end