Class: Stump::Mocks

Inherits:
Object show all
Defined in:
lib/stump/mocks.rb

Overview

A class to track the mocks and proxies that have been satisfied

Class Method Summary collapse

Class Method Details

.add(mock) ⇒ Object



9
10
11
12
# File 'lib/stump/mocks.rb', line 9

def add(mock)
  @mocks ||= []
  @mocks << mock
end

.clear!Object



22
23
24
# File 'lib/stump/mocks.rb', line 22

def clear!
  @mocks = []
end

.failuresObject



18
19
20
# File 'lib/stump/mocks.rb', line 18

def failures
  @mocks
end

.sizeObject



5
6
7
# File 'lib/stump/mocks.rb', line 5

def size
  @mocks ? 0 : @mocks.size 
end

.verify(mock) ⇒ Object



14
15
16
# File 'lib/stump/mocks.rb', line 14

def verify(mock)
  @mocks.delete(mock)
end