Class: FunWith::Gems::Testing::TestSuiteRunner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fwgem) ⇒ TestSuiteRunner

Returns a new instance of TestSuiteRunner.



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

def initialize fwgem
  self.gem_const = fwgem
end

Instance Attribute Details

#gem_constObject

Returns the value of attribute gem_const.



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

def gem_const
  @gem_const
end

Instance Method Details

#passes_tests?Boolean

Returns:

  • (Boolean)


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

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

#run_testsObject



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

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