gist: 7991 Download_button fork
public
Public Clone URL: git://gist.github.com/7991.git
Text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#Throw this in spec helper
def block_should(matcher, &block)
  block.should matcher
end
 
def block_should_not(matcher, &block)
  block.should_not matcher
end
 
#Use it like this
block_should change(Thing, :count).by(-1) do
 @thing.destroy
end
 
#Which is just a little cleaner version of this
lambda do
  @thing.destroy
end.should change(Thing, :count).by(1)

Owner

pjb3

Forks

Revisions