Move specFilter function to TrivialReporter.
This commit is contained in:
19
spec/suites/TrivialReporterTest.js
Normal file
19
spec/suites/TrivialReporterTest.js
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user