Sha256: 805883f62e2b95bc4fe09e5773707797f2b5634dee236cd71a0c746bfa716114
Contents?: true
Size: 1.24 KB
Versions: 2
Compression:
Stored size: 1.24 KB
Contents
require 'rubygems' require 'test/unit' require 'context' #gem install jeremymcanally-context -s http://gems.github.com require 'matchy' #gem install jeremymcanally-matchy -s http://gems.github.com require 'mocha' $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'bond' class Test::Unit::TestCase before(:all) { # Mock irb unless Object.const_defined?(:IRB) eval %[ module ::IRB class<<self; attr_accessor :CurrentContext; end module InputCompletor; CompletionProc = lambda {|e| [] }; end end ] ::IRB.CurrentContext = stub(:workspace=>stub(:binding=>binding)) end } def capture_stderr(&block) original_stderr = $stderr $stderr = fake = StringIO.new begin yield ensure $stderr = original_stderr end fake.string end def capture_stdout(&block) original_stdout = $stdout $stdout = fake = StringIO.new begin yield ensure $stdout = original_stdout end fake.string end def complete(full_line, last_word=full_line) Bond.agent.stubs(:line_buffer).returns(full_line) Bond.agent.call(last_word) end def valid_readline_plugin Module.new{ def setup; end; def line_buffer; end } end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
cldwalker-bond-0.1.1 | test/test_helper.rb |
bond-0.1.1 | test/test_helper.rb |