Class: HomeWorkChecker::TestRunStat::RubyTestRun
- Inherits:
-
Object
- Object
- HomeWorkChecker::TestRunStat::RubyTestRun
- Defined in:
- lib/hw_checker/ruby_test_run.rb
Instance Method Summary collapse
-
#initialize(tmp_path, dirname) ⇒ RubyTestRun
constructor
A new instance of RubyTestRun.
- #perform ⇒ Object
Constructor Details
#initialize(tmp_path, dirname) ⇒ RubyTestRun
Returns a new instance of RubyTestRun.
4 5 6 7 |
# File 'lib/hw_checker/ruby_test_run.rb', line 4 def initialize(tmp_path, dirname) @tmp_path, @dirname= tmp_path, dirname @passed = @failed = 0 end |
Instance Method Details
#perform ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/hw_checker/ruby_test_run.rb', line 9 def perform Dir.foreach("#{@tmp_path}/#{@dirname}/test") do |p| next unless File.file?("#{@tmp_path}/#{@dirname}/test/#{p}") && File.extname(p) == '.rb' `rspec #{@tmp_path}/#{@dirname}/test/#{p} > #{@tmp_path}/#{@dirname}/test/#{p}.tmp` count_passed_failed("#{@tmp_path}/#{@dirname}/test/#{p}.tmp") end calc_percent_passed end |