Sha256: dec4e88ddbd03c185958c9f143e390cbe94e9b3b2bb603e4ccdda6f250895e23
Contents?: true
Size: 732 Bytes
Versions: 101
Compression:
Stored size: 732 Bytes
Contents
require 'rake/file_utils_ext' require 'tmpdir' class ExerciseTestsRunner include Rake::FileUtilsExt def initialize(exercise:, test_options: '') @exercise = exercise @test_options = test_options end def run puts "\n\n#{'-' * 64}\nrunning tests for: #{@exercise}" Dir.mktmpdir(@exercise.name) do |dir| setup_exercise_files_in(dir) run_exercise_tests_in(dir) end end private def setup_exercise_files_in(dir) FileUtils.cp_r @exercise.directory, dir FileUtils.mv "#{dir}/#{@exercise.example_file}", "#{dir}/#{@exercise.testable_example_file}" end def run_exercise_tests_in(dir) ruby "-I lib -r disable_skip.rb #{dir}/#{@exercise.test_file} #{@test_options}" end end
Version data entries
101 entries across 101 versions & 1 rubygems