File: spec_should.rb

package info (click to toggle)
ruby-bacon 1.2.0-6.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 200 kB
  • sloc: ruby: 772; makefile: 7
file content (32 lines) | stat: -rw-r--r-- 702 bytes parent folder | download | duplicates (2)
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 'bacon'

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