summary refs log tree commit diff
path: root/test/spec_should.rb
blob: be340389e02315f2802a37a4dc1d55f4ab6bc927 (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
33
34
$: << File.dirname(__FILE__) + '/../lib/'
require 'bacon'


describe "#should shortcut for #it('should')" do
  
  should "be called" do
    @called= 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