pivotal/jasmine — Issue #199: Problem with toContain and regular expressions
Author: alightgoesout
Created: 2012-03-06 21:24:41+00:00
State: open

With an array of regular expression, it seems that toContain is always true.

This test case fails:

```
it("is crazy", function()
{
var array = [];
var p1 = /1/i;
var p2 = /2/i;
array.push(p1);
array.push(p2);
array.splice(0,1);
expect(array).toContain(p2);
expect(array).not.toContain(p1);
expect(array.length).toBe(1);
});
```

The error message says `Error: Expected [ /2/i ] not to contain /1/i.`. If `.not` is removed, the test case pass.