Skip to content

Commit

Permalink
Merge branch 'dflynn15-master' - Default spec_dir if not provided
Browse files Browse the repository at this point in the history
- Merges #70
- Fixes #69
  • Loading branch information
Gregg Van Hove committed Feb 22, 2016
2 parents ea5b1d5 + 5f74e43 commit 585f3fc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Jasmine.prototype.loadConfigFile = function(configFilePath) {

Jasmine.prototype.loadConfig = function(config) {
var jasmineRunner = this;
jasmineRunner.specDir = config.spec_dir;
jasmineRunner.specDir = config.spec_dir || '';

if(config.helpers) {
config.helpers.forEach(function(helperFile) {
Expand Down
20 changes: 20 additions & 0 deletions spec/jasmine_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,26 @@ describe('Jasmine', function() {

expect(this.fixtureJasmine.env.randomizeTests).toHaveBeenCalledWith(undefined);
});

describe('with options', function() {
it('instantiates spec_dir with the provided value', function() {
this.fixtureJasmine.loadConfig(this.configObject);

expect(this.fixtureJasmine.specDir).toEqual('spec');
});
});

describe('without options', function() {
it('falls back to an empty string with an undefined spec_dir', function() {
var config = this.configObject;
delete config.spec_dir;

this.fixtureJasmine.loadConfig(config);

expect(this.fixtureJasmine.specDir).toEqual('');
});
});

});

describe('from a file', function() {
Expand Down

0 comments on commit 585f3fc

Please sign in to comment.