Class: FunWith::Gems::TestSuiteRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/fun_with/gems/test_suite_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fwgem) ⇒ TestSuiteRunner

Returns a new instance of TestSuiteRunner.



6
7
8
# File 'lib/fun_with/gems/test_suite_runner.rb', line 6

def initialize fwgem
  self.gem_const = fwgem
end

Instance Attribute Details

#gem_constObject

Returns the value of attribute gem_const.



4
5
6
# File 'lib/fun_with/gems/test_suite_runner.rb', line 4

def gem_const
  @gem_const
end

Instance Method Details

#passes_tests?Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/fun_with/gems/test_suite_runner.rb', line 10

def passes_tests?
  result = self.run_tests
  result.passed?
end

#run_testsObject



15
16
17
18
19
20
21
22
23
# File 'lib/fun_with/gems/test_suite_runner.rb', line 15

def run_tests
  filepath = self.gem_const.root
  
  results = TestResults.new( self.gem_const )
  
  puts "running tests on #{self.gem_const} from #{filepath}"
  results.output = `cd #{filepath} && rake test`
  results
end