Returns new test suite list detected from Gem::Specification.
# File lib/gem2rpm/test_suite.rb, line 19 def initialize(spec) @items = detect_test_frameworks(spec) end
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.
# 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
# File lib/gem2rpm/test_suite.rb, line 35 def detect_test_frameworks(spec) from_development_dependencies(spec) # TODO: Try to guess the test framework from spec.files. This could # improve the test execution command a bit, but might not be reliable. end
# File lib/gem2rpm/test_suite.rb, line 41 def from_development_dependencies(spec) deps = spec.development_dependencies.map(&:name) TEST_FRAMEWORKS.select { |tf| deps.include?(tf.name) }.map(&:dup) end