Exemplo n.º 1
0
 Kosher.config.configure(testConfigPath, function(){
     console.log('Kosher configuration written to: '+testConfigPath);
     for(var prop in Kosher.config.schema().properties) {
         Kosher.config.config().should.have.property(prop);
     }
     done();
 });
Exemplo n.º 2
0
 it('should load variables from kosher.js if it exists', function(){
     if(Kosher.config.loadConfig(testConfigPath)){
         for(var prop in Kosher.config.schema().properties) {
             Kosher.config.config().should.have.property(prop);
         }
     }
 });
Exemplo n.º 3
0
        it('should not load variables from kosher.js if they are already set in the process environment', function(){
            process.env.jiraUrl = 'http://localhost';
            process.env.jiraProject = 'TEST';
            process.env.featuresPath = 'foo/features/';

            if(Kosher.config.loadConfig(testConfigPath)){
                var config = Kosher.config.config();

                for(var prop in Kosher.config.schema().properties) {
                    config.should.have.property(prop);
                }

                config.jiraUrl.should.equal(process.env.jiraUrl);
                config.jiraProject.should.equal(process.env.jiraProject);
                config.featuresPath.should.equal(process.env.featuresPath);
            };
        });
Exemplo n.º 4
0
 it.skip('should allow the user to complete interactive configuration', function(done){
     Kosher.config.configure(testConfigPath, function(){
         console.log('Kosher configuration written to: '+testConfigPath);
         for(var prop in Kosher.config.schema().properties) {
             Kosher.config.config().should.have.property(prop);
         }
         done();
     });
 });
Exemplo n.º 5
0
"use strict"

var path = require('path');
var fs = require('fs');

var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib/');

var Kosher = require(lib+'kosher.js').kosher;
var config = Kosher.config.config();

function getFeature(data, withSpec) {
    var features = withSpec?data.match(/Feature:[\s\S]*?#/):data.match(/.*Feature:.*/);

    if(!!features && features.length > 0)
        return withSpec?features[0].substr(0,features[0].length-1):features[0];
    else
        return ['** [WARN]: NO FEATURE FOUND **'];
};

function getScenarios(data, withSpec) {
    var scenarios = withSpec?data.match(/.*Scenario:[\s\S]*?#/g):data.match(/.*Scenario:.*/g);

    if(!!scenarios && scenarios.length > 0){
        if(withSpec) {
            for(var i = 0; i < scenarios.length; i++) {
                scenarios[i] = scenarios[i].substr(0,scenarios[i].length-1);
            }
            return scenarios;
        } else {
            return scenarios;
        }