mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
hopefully fix run --once test on release
This commit is contained in:
@@ -464,6 +464,15 @@ _.extend(Sandbox.prototype, {
|
||||
fs.writeFileSync(path.join(self.cwd, filename), contents, 'utf8');
|
||||
},
|
||||
|
||||
// Reads a file in the sandbox as a utf8 string. 'filename' is a path
|
||||
// intepreted relative to the Sandbox's cwd. throws if the file does not
|
||||
// exist.
|
||||
// XXX maybe it should return null if the file does not exist?
|
||||
read: function (filename) {
|
||||
var self = this;
|
||||
return fs.readFileSync(path.join(self.cwd, filename), 'utf8');
|
||||
},
|
||||
|
||||
// Delete a file in the sandbox. 'filename' is as in write().
|
||||
unlink: function (filename) {
|
||||
var self = this;
|
||||
|
||||
@@ -53,12 +53,13 @@ selftest.define("run --once", function () {
|
||||
run.waitSecs(5);
|
||||
run.match("once test\n");
|
||||
s.write('empty.js', 'null');
|
||||
var originalRelease = s.read('.meteor/release');
|
||||
s.write('.meteor/release', 'v1');
|
||||
utils.sleepMs(2000); // sorry, hard to avoid
|
||||
run.stop();
|
||||
run.forbidAll("updated");
|
||||
s.unlink('empty.js');
|
||||
s.write('.meteor/release', 'none');
|
||||
s.write('.meteor/release', originalRelease);
|
||||
|
||||
// running a different program
|
||||
run = s.run("--once", "--program", "other");
|
||||
|
||||
Reference in New Issue
Block a user