Skip to content
Browse files

Added custom matcher spec to verify that Jessie supports Jasmine cust…

…om matchers
  • Loading branch information...
1 parent 055e1ef commit 4dad5f7ba50545cedfa437841ba5567eb0112e3d Marcin Bunsch committed Jun 6, 2011
Showing with 26 additions and 10 deletions.
  1. +8 −8 spec/jessie/ansi_spec.js
  2. +7 −0 spec/jessie/custom_matchers_spec.js
  3. +2 −2 spec/jessie/finder_spec.js
  4. +9 −0 spec/spec_helper.js
View
16 spec/jessie/ansi_spec.js
@@ -1,25 +1,25 @@
describe('jessie.ansi', function() {
-
+
var ansi = require('jessie/ansi')
it('should have proper red', function() {
- ansi.red.should_match(/\033\[31m/)
+ ansi.red.should_match(/\033\[31m/)
})
it('should have proper green', function() {
- ansi.green.should_match(/\033\[32m/)
+ ansi.green.should_match(/\033\[32m/)
})
-
+
it('should have proper yellow', function() {
- ansi.yellow.should_match(/\033\[33m/)
+ ansi.yellow.should_match(/\033\[33m/)
})
it('should have proper grey', function() {
- ansi.grey.should_match(/\033\[90m/)
+ ansi.grey.should_match(/\033\[90m/)
})
it('should have a cancel color', function() {
- ansi.none.should_match(/\033\[0m/)
+ ansi.none.should_match(/\033\[0m/)
})
-
+
})
View
7 spec/jessie/custom_matchers_spec.js
@@ -0,0 +1,7 @@
+describe('Jessie', function() {
+
+ it('should support custom matchers', function() {
+ expect(3).toBeGreaterThanTwo()
+ })
+
+})
View
4 spec/jessie/finder_spec.js
@@ -3,7 +3,7 @@ describe('jessie.finder', function() {
var finder = new (require('jessie/finder').finder)()
it("should find files if only dir is specified", function() {
- finder.find(['spec']).length.should_be(11)
+ finder.find(['spec']).length.should_be(12)
})
it("should find coffee script files", function() {
@@ -23,7 +23,7 @@ describe('jessie.finder', function() {
})
it('leaves non-relative paths alone', function() {
- finder.find([path.resolve('spec')]).length.should_be(11)
+ finder.find([path.resolve('spec')]).length.should_be(12)
});
it("should find files if only files are specified", function() {
View
9 spec/spec_helper.js
@@ -2,3 +2,12 @@ var jessie = require('jessie')
jessie.sugar()
require('coffee-script');
+
+// Custom matcher
+beforeEach(function(){
+ this.addMatchers({
+ toBeGreaterThanTwo: function(number) {
+ return !(number <= 2)
+ }
+ });
+});

0 comments on commit 4dad5f7

Please sign in to comment.
Something went wrong with that request. Please try again.