lib/exercism/assignment.rb in exercism-0.0.9 vs lib/exercism/assignment.rb in exercism-0.0.10
- old
+ new
@@ -20,16 +20,24 @@
@project_dir = attributes['project_dir']
end
def save
FileUtils.mkdir_p assignment_dir
+ save_readme
+ save_tests unless File.exist?(tests_path)
+ self
+ end
+
+ def save_readme
File.open readme_path, 'w' do |f|
f.write readme
end
+ end
+
+ def save_tests
File.open tests_path, 'w' do |f|
f.write tests
end
- self
end
def assignment_dir
@assignment_dir ||= File.join(project_dir, track, slug)
end