Skip to content

Commit

Permalink
chore(gulp): add rspec tests to gulp test task
Browse files Browse the repository at this point in the history
[Finishes #82250646]

Signed-off-by: Bebe Peng <bpeng@pivotal.io>
  • Loading branch information
Paul Meskers committed Dec 3, 2014
1 parent fed9d84 commit 70e5378
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions tasks/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require('shelljs/global');
var ejs = require('gulp-ejs');
var connect = require('gulp-connect');
var errorHandler = require('./errorHandler.js');
var fs = require('fs');
var gulp = require('gulp');
Expand All @@ -7,6 +9,7 @@ var open = require('gulp-open');
gulp.task('test', [
'lint',
'_cssCritic',
'_rspec',
]);

gulp.task('_copyTestAssets', ['assets'], function() {
Expand All @@ -30,7 +33,24 @@ gulp.task('_createTestFileList', ['assets'], function(done) {
});
});

gulp.task('_serveTest', ['assets'], function() {
connect.server({
root: ['build'],
port: 9001
});
});

gulp.task('_cssCritic', ['lint', '_copyTestAssets', '_createTestFileList'], function() {
return gulp.src("./test/regressionRunner.html")
.pipe(open("./test/regressionRunner.html",{app:"firefox"}));
});

gulp.task('_rspec', ['_serveTest'], function(done) {
exec('rspec test/styleguide', function(exitStatus) {
if (exitStatus !== 0) {
errorHandler.handleError('Exiting: Specs Failed', {isFatal: true});
}
connect.serverClose();
done();
});
});
2 changes: 1 addition & 1 deletion test/styleguide/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Capybara::Selenium::Driver.new(app, browser: :chrome)
end

Capybara.app_host = 'http://localhost:8000'
Capybara.app_host = 'http://localhost:9001'
Capybara.run_server = false
Capybara.javascript_driver = :chrome

Expand Down

0 comments on commit 70e5378

Please sign in to comment.