test/exercism/assignment_test.rb in exercism-0.0.12 vs test/exercism/assignment_test.rb in exercism-0.0.13
- old
+ new
@@ -1,8 +1,8 @@
require './test/test_helper'
-class AssignmentTest < MiniTest::Unit::TestCase
+class AssignmentTest < Minitest::Test
def project_dir
'/tmp'
end
@@ -17,19 +17,19 @@
def tests_dir
File.join(project_dir, 'ruby', 'queens')
end
def tests_path
- File.join(tests_dir, 'test.rb')
+ File.join(tests_dir, 'queens_test.rb')
end
def assignment_data
{
'track' => 'ruby',
'slug' => 'queens',
'readme' => 'Do it',
- 'test_file' => 'test.rb',
+ 'test_file' => 'queens_test.rb',
'tests' => 'assert true',
'project_dir' => project_dir
}
end
@@ -49,8 +49,16 @@
end
Exercism::Assignment.new(assignment_data).save
assert_equal "assert false", File.read(tests_path)
+ end
+
+ def test_save_and_return_assignments
+ data = { 'assignments' => [ assignment_data ] }
+ saved = Exercism::Assignment.save(data, project_dir)
+
+ assert_equal 1, saved.size
+ assert_equal assignment_data['slug'], saved.first.slug
end
end