Sha256: 5a5a288c59b2ca7f09e3f89bda2f38504f9786070787b5a84fd8e688555d7324

Contents?: true

Size: 919 Bytes

Versions: 2

Compression:

Stored size: 919 Bytes

Contents

require 'rubygems'
require 'bacon'

$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'helpers'

Bacon.summary_on_exit

shared 'has standard setup' do
  before do
    CrossStub.setup(:file => $cache_file)
  end
  after do
    CrossStub.clear
  end
end

shared 'has current process setup' do
  before do
    @get_value = lambda do |klass_and_method_and_args|
      klass, method, *args = klass_and_method_and_args.split('.')
      args.empty? ? Object.const_get(klass).send(method) :
        Object.const_get(klass).send(method, *args)
    end
  end
end

shared 'has other process setup' do
  before do
    EchoServer.start
    @get_value = lambda do |klass_and_method_and_args|
      (value = EchoClient.get(klass_and_method_and_args)) !~ /^undefined method/ ? value :
        Object.we_just_wanna_trigger_a_no_method_error_with_this_very_long_and_weird_method!
    end
  end
  after do
    EchoServer.stop
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cross-stub-0.1.1 spec/spec_helper.rb
cross-stub-0.1.0 spec/spec_helper.rb