Move specFilter function to TrivialReporter.

This commit is contained in:
Aaron Peckham & Christian Williams
2009-08-10 16:00:42 -07:00
parent e476f2375a
commit b1a007dfb5
4 changed files with 52 additions and 39 deletions

View File

@@ -0,0 +1,19 @@
describe("TrivialReporter", function() {
function fakeSpec(name) {
return {
getFullName: function() { return name; }
};
}
it("should allow for focused spec running", function() {
var trivialReporter = new jasmine.TrivialReporter();
spyOn(trivialReporter, 'getLocation').andReturn({search: "?spec=run%20this"});
expect(trivialReporter.specFilter(fakeSpec("run this"))).toBeTruthy();
});
it("should not run specs that don't match the filter", function() {
var trivialReporter = new jasmine.TrivialReporter();
spyOn(trivialReporter, 'getLocation').andReturn({search: "?spec=run%20this"});
expect(trivialReporter.specFilter(fakeSpec("not the right spec"))).toBeFalsy();
});
});