Class: Shuttlecraft::Test::StubMothership

Inherits:
Object
  • Object
show all
Defined in:
lib/shuttlecraft/test.rb

Instance Method Summary collapse

Constructor Details

#initializeStubMothership

Returns a new instance of StubMothership.



14
15
16
# File 'lib/shuttlecraft/test.rb', line 14

def initialize
  @tuples = []
end

Instance Method Details

#read_all(template) ⇒ Object



26
27
28
29
30
# File 'lib/shuttlecraft/test.rb', line 26

def read_all(template)
  @tuples.map{|t,r| t}.select do |t|
    template[1].nil? or template[1] === t[1]
  end
end

#take(*args) ⇒ Object



22
23
24
# File 'lib/shuttlecraft/test.rb', line 22

def take(*args)
  @tuples.delete(args)
end

#write(*args) ⇒ Object



18
19
20
# File 'lib/shuttlecraft/test.rb', line 18

def write(*args)
  @tuples << args
end