Class: Gem2Rpm::TestSuite

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/gem2rpm/test_suite.rb

Defined Under Namespace

Classes: TestFramework

Constant Summary collapse

TEST_FRAMEWORKS =
[
  TestFramework.new('cucumber', %|cucumber|),
  TestFramework.new('minitest', %|ruby -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'|),
  TestFramework.new('rspec', %|rspec spec|),
  TestFramework.new('shindo', %|shindont|),
  TestFramework.new('test-unit', %|ruby -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'|),
  TestFramework.new('bacon', %|bacon -a|),
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ TestSuite

Returns new test suite list detected from Gem::Specification.



19
20
21
# File 'lib/gem2rpm/test_suite.rb', line 19

def initialize(spec)
  @items = detect_test_frameworks(spec)
end

Instance Method Details

#eachObject

Calls the given block once for each element in self, passing that element as a parameter. Returns the array itself. If no block is given, an Enumerator is returned.



26
27
28
29
30
31
# File 'lib/gem2rpm/test_suite.rb', line 26

def each
  # Return Enumerator when called withoug block.
  return to_enum(__callee__) unless block_given?

  @items.each { |item| yield item }
end