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:
gvanhove
2011-11-14 18:43:13 -08:00
parent ac096f9911
commit d70e733f70
2 changed files with 6 additions and 6 deletions

View File

@@ -945,35 +945,35 @@ describe("jasmine.Matchers", function() {
var any;
describe(".jasmineToString", 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);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Object.*\)>/);
});
});
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);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function 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);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function String.*\)>/);
});
});
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);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Number.*\)>/);
});
});
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 () {}
any = jasmine.any(MyClass);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function MyClass.*\)>/);

View File

@@ -31,7 +31,7 @@ end
def count_specs_in(files)
files.inject(0) do |count, file|
File.read(file).scan(/\sit\(/) {|s| count += 1}
File.read(file).scan(/\sit\s*\(/) {|s| count += 1}
count
end
end