| 754 | } |
| 755 | |
| 756 | function writeAndCommitFileInLive(fileName, fileContents) { |
| 757 | describe(`commit a change to ${fileName} by exec`, function() { |
| 758 | it('should write', function(callback) { |
| 759 | fs.writeFile(path.join(courseLiveDir, fileName), fileContents, (err) => { |
| 760 | if (ERR(err, callback)) return; |
| 761 | callback(null); |
| 762 | }); |
| 763 | }); |
| 764 | it('should add', function(callback) { |
| 765 | const execOptions = { |
| 766 | cwd: courseLiveDir, |
| 767 | env: process.env, |
| 768 | }; |
| 769 | exec(`git add -A`, execOptions, (err) => { |
| 770 | if (ERR(err, callback)) return; |
| 771 | callback(null); |
| 772 | }); |
| 773 | }); |
| 774 | it('should commit', function(callback) { |
| 775 | const execOptions = { |
| 776 | cwd: courseLiveDir, |
| 777 | env: process.env, |
| 778 | }; |
| 779 | exec(`git commit -m "commit from writeFile"`, execOptions, (err) => { |
| 780 | if (ERR(err, callback)) return; |
| 781 | callback(null); |
| 782 | }); |
| 783 | }); |
| 784 | }); |
| 785 | } |
| 786 | |
| 787 | function pullAndVerifyFileInDev(fileName, fileContents) { |
| 788 | describe(`pull in dev and verify contents of ${fileName}`, function() { |