Move specFilter function to TrivialReporter.
This commit is contained in:
@@ -37,31 +37,11 @@
|
||||
jasmine.include('suites/RunnerTest.js', true);
|
||||
jasmine.include('suites/SpecRunningTest.js', true);
|
||||
jasmine.include('suites/SpyTest.js', true);
|
||||
jasmine.include('suites/TrivialReporterTest.js', true);
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
.spec {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.passed {
|
||||
background-color: lightgreen;
|
||||
}
|
||||
|
||||
.failed {
|
||||
background-color: pink;
|
||||
}
|
||||
|
||||
.resultMessage {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.stackTrace {
|
||||
white-space: pre;
|
||||
font-size: .8em;
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
<link href="../lib/jasmine.css" rel="stylesheet"/>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
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