remove unwanted spaces in it calls, and make the spec counting regex tolerate them if they exist so counts match even when using bad style
This commit is contained in:
@@ -945,35 +945,35 @@ describe("jasmine.Matchers", function() {
|
|||||||
var any;
|
var any;
|
||||||
describe(".jasmineToString", function () {
|
describe(".jasmineToString", function () {
|
||||||
describe("with Object", function () {
|
describe("with Object", function () {
|
||||||
it ("says it's looking for an object", function () {
|
it("says it's looking for an object", function () {
|
||||||
any = jasmine.any(Object);
|
any = jasmine.any(Object);
|
||||||
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Object.*\)>/);
|
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Object.*\)>/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("with Function", function () {
|
describe("with Function", function () {
|
||||||
it ("says it's looking for a function", function () {
|
it("says it's looking for a function", function () {
|
||||||
any = jasmine.any(Function);
|
any = jasmine.any(Function);
|
||||||
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Function.*\)>/);
|
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Function.*\)>/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("with String", function () {
|
describe("with String", function () {
|
||||||
it ("says it's looking for a string", function () {
|
it("says it's looking for a string", function () {
|
||||||
any = jasmine.any(String);
|
any = jasmine.any(String);
|
||||||
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function String.*\)>/);
|
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function String.*\)>/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("with Number", function () {
|
describe("with Number", function () {
|
||||||
it ("says it's looking for a number", function () {
|
it("says it's looking for a number", function () {
|
||||||
any = jasmine.any(Number);
|
any = jasmine.any(Number);
|
||||||
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Number.*\)>/);
|
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Number.*\)>/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("with some other defined 'class'", function () {
|
describe("with some other defined 'class'", function () {
|
||||||
it ("says it's looking for an object", function () {
|
it("says it's looking for an object", function () {
|
||||||
function MyClass () {}
|
function MyClass () {}
|
||||||
any = jasmine.any(MyClass);
|
any = jasmine.any(MyClass);
|
||||||
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function MyClass.*\)>/);
|
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function MyClass.*\)>/);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ end
|
|||||||
|
|
||||||
def count_specs_in(files)
|
def count_specs_in(files)
|
||||||
files.inject(0) do |count, file|
|
files.inject(0) do |count, file|
|
||||||
File.read(file).scan(/\sit\(/) {|s| count += 1}
|
File.read(file).scan(/\sit\s*\(/) {|s| count += 1}
|
||||||
count
|
count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user