Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding a blueprint uninstall test #3756

Merged
merged 1 commit into from Apr 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
57 changes: 57 additions & 0 deletions tests/unit/models/blueprint-test.js
Expand Up @@ -483,6 +483,63 @@ describe('Blueprint', function() {
});
});

describe('basic blueprint uninstallation', function() {
var BasicBlueprintClass = require(basicBlueprint);
var blueprint;
var ui;
var project;
var options;
var tmpdir;

function refreshUI() {
ui = new MockUI();
options.ui = ui;
}

beforeEach(function() {
tmpdir = tmp.in(tmproot);
blueprint = new BasicBlueprintClass(basicBlueprint);
project = new MockProject();
options = {
project: project,
target: tmpdir
};

refreshUI();
return blueprint.install(options)
.then(refreshUI);
});

afterEach(function() {
return remove(tmproot);
});

it('uninstalls basic files', function() {
expect(!!blueprint).to.equal(true);

return blueprint.uninstall(options)
.then(function() {
var actualFiles = walkSync(tmpdir);
var output = ui.output.trim().split(EOL);

expect(output.shift()).to.match(/^uninstalling/);
expect(output.shift()).to.match(/remove.* .ember-cli/);
expect(output.shift()).to.match(/remove.* .gitignore/);
expect(output.shift()).to.match(/remove.* bar/);
expect(output.shift()).to.match(/remove.* foo.txt/);
expect(output.shift()).to.match(/remove.* test.txt/);
expect(output.length).to.equal(0);

expect(actualFiles.length).to.equal(0);

fs.exists(path.join(tmpdir, 'test.txt'),
function(exists) {
expect(exists).to.be.false;
});
});
});
});

describe('addPackageToProject', function() {
var blueprint;
var ui;
Expand Down