Compare commits

..

No commits in common. "class-names-as-descriptions" and "master" have entirely different histories.

4 changed files with 7 additions and 27 deletions

View File

@ -1917,7 +1917,7 @@ jasmine.Spec = function(env, suite, description) {
};
jasmine.Spec.prototype.getFullName = function() {
var description = (typeof this.description == 'function' || this.description instanceof Function) ? this.description.name : this.description;
var description = (this.description.apply ? this.description.name : this.description);
return this.suite.getFullName() + ' ' + description + '.';
};
@ -2154,17 +2154,13 @@ jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
};
jasmine.Suite.prototype.getFullName = function() {
var fullName = this.getDescription()
var fullName = (this.description.apply ? this.description.name : this.description);
for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
fullName = parentSuite.getDescription() + ' ' + fullName;
fullName = parentSuite.description + ' ' + fullName;
}
return fullName;
};
jasmine.Suite.prototype.getDescription = function() {
return (typeof this.description == 'function' || this.description instanceof Function) ? this.description.name : this.description;
};
jasmine.Suite.prototype.finish = function(onComplete) {
this.env.reporter.reportSuiteResults(this);
this.finished = true;
@ -2473,5 +2469,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
"revision": 1307554069
"revision": 1307455841
};

View File

@ -80,18 +80,6 @@ describe('Suite', function() {
expect(suite.getFullName()).toEqual("MyClass");
expect(suite.children()[0].getFullName()).toEqual("MyClass should be something.");
});
it('should use the name of the parent suite correctly', function() {
suite = env.describe(MyClass, function() {
env.describe('nested', function() {
env.it('should be something', function() {
});
});
});
expect(suite.getFullName()).toEqual("MyClass");
expect(suite.suites()[0].getFullName()).toEqual("MyClass nested");
});
});
});

View File

@ -29,7 +29,7 @@ jasmine.Spec = function(env, suite, description) {
};
jasmine.Spec.prototype.getFullName = function() {
var description = (typeof this.description == 'function' || this.description instanceof Function) ? this.description.name : this.description;
var description = (this.description.apply ? this.description.name : this.description);
return this.suite.getFullName() + ' ' + description + '.';
};

View File

@ -22,17 +22,13 @@ jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
};
jasmine.Suite.prototype.getFullName = function() {
var fullName = this.getDescription()
var fullName = (this.description.apply ? this.description.name : this.description);
for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
fullName = parentSuite.getDescription() + ' ' + fullName;
fullName = parentSuite.description + ' ' + fullName;
}
return fullName;
};
jasmine.Suite.prototype.getDescription = function() {
return (typeof this.description == 'function' || this.description instanceof Function) ? this.description.name : this.description;
};
jasmine.Suite.prototype.finish = function(onComplete) {
this.env.reporter.reportSuiteResults(this);
this.finished = true;