tracks/ruby/test/generator/files/track_files_test.rb in trackler-2.1.0.11 vs tracks/ruby/test/generator/files/track_files_test.rb in trackler-2.1.0.12

- old
+ new

@@ -9,52 +9,46 @@ ) class TestTrackFiles def initialize @paths = FixturePaths - @exercise_name = 'alpha' + @slug = 'alpha-beta' + @exercise_name = 'alpha_beta' end - attr_accessor :paths, :exercise_name + attr_accessor :paths, :slug, :exercise_name include TrackFiles end def test_tests_version subject = TestTrackFiles.new assert_instance_of TestsVersionFile, subject.tests_version end def test_example_solution subject = TestTrackFiles.new - expected_filename = FixturePaths.track + '/exercises/alpha/.meta/solutions/alpha.rb' + expected_filename = FixturePaths.track + '/exercises/alpha-beta/.meta/solutions/alpha_beta.rb' assert_equal expected_filename, subject.example_solution.filename end - def test_legacy_example_solution - subject = TestTrackFiles.new - subject.exercise_name = 'beta' - expected_filename = FixturePaths.track + '/exercises/beta/example.rb' - assert_equal expected_filename, subject.example_solution.filename - end - def test_minitest_tests subject = TestTrackFiles.new assert_instance_of MinitestTestsFile, subject.minitest_tests end def test_tests_template subject = TestTrackFiles.new - expected_filename = FixturePaths.track + '/exercises/alpha/.meta/generator/test_template.erb' + expected_filename = FixturePaths.track + '/exercises/alpha-beta/.meta/generator/test_template.erb' assert_equal expected_filename, subject.tests_template.filename end class TestTrackFilesUseDefault def initialize @paths = FixturePaths - @exercise_name = 'notemplate' + @slug = 'notemplate' end - attr_reader :paths, :exercise_name + attr_reader :paths, :slug include TrackFiles end def test_default_tests_template subject = TestTrackFilesUseDefault.new @@ -96,10 +90,10 @@ def save(content) content end end - def test_update_version + def test_generate mock_template = Minitest::Mock.new mock_values = Minitest::Mock.new mock_values.expect :get_binding, 'mock binding' mock_erb = Minitest::Mock.new mock_erb.expect :result, 'new content', ['mock binding']