Class: Busted::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/busted/stack.rb

Instance Method Summary collapse

Constructor Details

#initializeStack

Returns a new instance of Stack.



5
6
7
8
9
# File 'lib/busted/stack.rb', line 5

def initialize
  @started = []
  @finished = []
  @lock = Monitor.new
end

Instance Method Details

#finishedObject



19
20
21
# File 'lib/busted/stack.rb', line 19

def finished
  @lock.synchronize { @finished.pop }
end

#finished=(element) ⇒ Object



23
24
25
# File 'lib/busted/stack.rb', line 23

def finished=(element)
  @lock.synchronize { @finished.push element }
end

#startedObject



11
12
13
# File 'lib/busted/stack.rb', line 11

def started
  @lock.synchronize { @started.pop }
end

#started=(element) ⇒ Object



15
16
17
# File 'lib/busted/stack.rb', line 15

def started=(element)
  @lock.synchronize { @started.push element }
end