summary refs log tree commit diff
path: root/test/spec_should.rb
blob: 4986aa27468eff6032c0fe453c0f229fe4913a50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require File.expand_path('../../lib/bacon', __FILE__)

describe "#should shortcut for #it('should')" do
  
  should "be called" do
    @called = true
    @called.should.be == true
  end
  
  should "save some characters by typing should" do
    lambda { should.satisfy { 1 == 1 } }.should.not.raise
  end

  should "save characters even on failure" do
    lambda { should.satisfy { 1 == 2 } }.should.raise Bacon::Error
  end

  should "work nested" do
    should.satisfy {1==1}
  end
  
  count = Bacon::Counter[:specifications]
  should "add new specifications" do
    # XXX this should +=1 but it's +=2
    (count+1).should == Bacon::Counter[:specifications]
  end

  should "have been called" do
    @called.should.be == true
  end

end