Sha256: 21bb28c3a404677559745936ab8d994f7e024ddc3c82c08917427ae642a9f727
Contents?: true
Size: 1.34 KB
Versions: 42
Compression:
Stored size: 1.34 KB
Contents
require_relative '../test_helper' require 'tasks/exercise' require 'tasks/exercise_test_tasks' class ExerciseTestTasksTest < Minitest::Test def test_all_exercises_task setup_rake Exercise.stub :all, ['test1', 'test2'] do ExerciseTestTasks.new(options: '') assert_equal ['test1', 'test2'], Rake::Task['exercises'].prerequisites assert_equal 'Run the tests for all exercises', Rake::Task['exercises'].comment end end def test_individual_exercise_tasks setup_rake Exercise.stub :all, ['test1', 'test2'] do mock_test_runner_instance = Minitest::Mock.new mock_test_runner_instance.expect :run, nil mock_test_runner_instance.expect :run, nil mock_test_runner = Minitest::Mock.new mock_test_runner.expect( :new, mock_test_runner_instance, [exercise: 'test1', test_options: '-p'], ) mock_test_runner.expect( :new, mock_test_runner_instance, [exercise: 'test2', test_options: '-p'], ) ExerciseTestTasks.new(options: '-p', test_runner: mock_test_runner) Rake::Task['test1'].invoke Rake::Task['test2'].invoke mock_test_runner.verify mock_test_runner_instance.verify end end def setup_rake Rake.application = Rake::Application.new Rake::TaskManager.record_task_metadata = true end end
Version data entries
42 entries across 42 versions & 1 rubygems