forked from sintaxi/harp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test CLI behavior with nixt, starting with
harp init
- Loading branch information
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
var nixt = require('nixt') | ||
|
||
describe("harp init", function() { | ||
|
||
beforeEach(function(done){ | ||
nixt() | ||
.run("rm -rf /tmp/harp && mkdir /tmp/harp") | ||
.exist("/tmp/harp") | ||
.end(done) | ||
}) | ||
|
||
it("downloads the default boilerplate if it's not set", function(done) { | ||
nixt() | ||
.run('harp init /tmp/harp') | ||
.stdout(/Downloading.*harp-boilerplates\/default/) | ||
.stdout(/Initialized project at \/tmp\/harp/) | ||
.exist('/tmp/harp/404.jade') | ||
.exist('/tmp/harp/_layout.jade') | ||
.exist('/tmp/harp/index.jade') | ||
.exist('/tmp/harp/main.less') | ||
.end(done) | ||
}) | ||
|
||
it("defaults to the harp-boilerplates github org when given a shorthand pattern", function(done) { | ||
nixt() | ||
.run('harp init /tmp/harp -b hb-start') | ||
.stdout(/Downloading.*harp-boilerplates\/hb-start/) | ||
.exist('/tmp/harp/public') | ||
.end(done) | ||
}) | ||
|
||
it("honors -b option when given a user/repo pattern", function(done) { | ||
nixt() | ||
.run('harp init /tmp/harp -b zeke/harp-sample') | ||
.stdout(/Downloading.*zeke\/harp-sample/) | ||
.exist('/tmp/harp/README.md') | ||
.exist('/tmp/harp/index.jade') | ||
.end(done) | ||
}) | ||
|
||
it("doesn't overwrite an existing directory", function(done) { | ||
nixt() | ||
.run('harp init /tmp/harp') | ||
.end(function() { | ||
nixt() | ||
.run('harp init /tmp/harp') | ||
.stdout(/Sorry,.*must be empty/) | ||
.end(done) | ||
}) | ||
}) | ||
|
||
}) |