Class: Pork::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/rest-builder/test.rb

Instance Method Summary collapse

Instance Method Details

#stub_select_for_stringioObject



22
23
24
25
# File 'lib/rest-builder/test.rb', line 22

def stub_select_for_stringio
  stub(IO).select(where([is_a(StringIO)]), [], [],
                  RestBuilder::EventSource::READ_WAIT){ |rd, *| rd }
end

#with_imgObject



12
13
14
15
16
17
18
19
20
# File 'lib/rest-builder/test.rb', line 12

def with_img
  f = Tempfile.new(['img', '.jpg'])
  n = File.basename(f.path)
  f.write('a'*10)
  f.rewind
  yield(f, n)
ensure
  f.close!
end