test/exercism/api_test.rb in exercism-0.0.11 vs test/exercism/api_test.rb in exercism-0.0.12
- old
+ new
@@ -42,9 +42,24 @@
Approvals.verify(File.read(tests_path), name: 'alice_gets_bob_tests')
end
end
end
+ def test_fetch_upcoming_assignment_from_api
+ assignment_dir = File.join(project_dir, 'ruby', 'word-count')
+ readme_path = File.join(assignment_dir, 'README.md')
+ tests_path = File.join(assignment_dir, 'test.rb')
+
+ Exercism.stub(:home, home) do
+ VCR.use_cassette('alice-gets-word-count') do
+ Exercism::Api.new('http://localhost:4567', Exercism.user, project_dir).peek
+
+ Approvals.verify(File.read(readme_path), name: 'alice_gets_word_count_readme')
+ Approvals.verify(File.read(tests_path), name: 'alice_gets_word_count_tests')
+ end
+ end
+ end
+
def test_send_assignment_to_api
assignment_dir = File.join(project_dir, 'ruby', 'bob')
FileUtils.mkdir_p(assignment_dir)
submission = File.join(assignment_dir, 'bob.rb')
File.open(submission, 'w') do |f|