Sha256: f14a340e3e76dcc6e8db04815c02ee0c3200331d8f0567494ca46c5095d0538e

Contents?: true

Size: 875 Bytes

Versions: 1

Compression:

Stored size: 875 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', 'spec_helper')
require File.join(File.dirname(__FILE__), '..', 'includes')
require File.join(File.dirname(__FILE__), '..', 'service')

shared 'has standard setup' do
  before { CrossStub.setup(cache_store(@store_type)) }
  after { CrossStub.clear }
end

shared 'has current process setup' do
  behaves_like 'has standard setup'
  before { @call = Object.method(:do_local_method_call) }
end

shared 'has other process setup' do

  behaves_like 'has standard setup'

  before do
    @call = lambda do |klass_and_method_and_args|
      do_remote_method_call("%s/%s" % [@store_type, klass_and_method_and_args])
    end
    $service_started ||= (
      EchoServer.start if ENV['ECHO_SERVER'] != 'false'
      true
    )
  end

end

at_exit do
  $service_started && (
    EchoServer.stop unless ENV['ECHO_SERVER'] == 'false'
  )
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cross-stub-0.2.0 spec/integration/shared_spec.rb