Skip to content

Commit

Permalink
throw_error spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Feb 6, 2009
1 parent e3499aa commit 51cae19
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions spec/matchers_spec.js
Expand Up @@ -249,15 +249,22 @@ Screw.Unit(function() {
});

describe("#have_method", function() {
var m;
var a;
before(function() {
m = new Array(42);
a = new Array(42);
});
it("returns true for objects that have the method", function() {
expect(m).to(have_method,'pop');
expect(a).to(have_method,'pop');
});
it("returns false for objects that do not have the method", function() {
expect(m).to_not(have_method,'bessel');
expect(a).to_not(have_method,'bessel');
});
});

describe("#throw_error", function() {
it("returns true for functions that throw the error msg", function() {
expect(function() { var m = new Math; }).to(throw_error,
'TypeError: Math is not a constructor');
});
});
});
Expand Down

0 comments on commit 51cae19

Please sign in to comment.