Sha256: 49f55fd6ef8ed1cb2391c772482768a95e246dc06f76d9664f253fb6929e3840

Contents?: true

Size: 1.54 KB

Versions: 10

Compression:

Stored size: 1.54 KB

Contents

require 'test_helper'

module Vedeu

  module Distributed

    describe Client do

      let(:described) { Vedeu::Distributed::Client }
      let(:instance)  { described.new(uri) }
      let(:uri)       { 'druby://localhost:21420' }

      before { $stdout.stubs(:puts) }

      describe 'alias methods' do
        it { instance.must_respond_to(:read) }
        it { instance.must_respond_to(:write) }
      end

      describe '#initialize' do
        it { instance.must_be_instance_of(described) }
        it { instance.instance_variable_get('@uri').must_equal('druby://localhost:21420') }
      end

      describe '.connect' do
        subject { described.connect(uri) }

        context 'when the DRb server is not available or not enabled' do
          it { subject.must_equal(:drb_connection_error) }
        end
      end

      describe '#input' do
        let(:data) {}

        subject { instance.input(data) }

        context 'when the DRb server is not available or not enabled' do
          it { subject.must_equal(:drb_connection_error) }
        end
      end

      describe '#output' do
        subject { instance.output }

        context 'when the DRb server is not available or not enabled' do
          it { subject.must_equal(:drb_connection_error) }
        end
      end

      describe '#shutdown' do
        subject { instance.shutdown }

        context 'when the DRb server is not available or not enabled' do
          it { subject.must_equal(:drb_connection_error) }
        end
      end

    end # Client

  end # Distributed

end # Vedeu

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vedeu-0.4.13 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.12 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.11 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.10 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.9 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.8 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.7 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.6 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.5 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.4 test/lib/vedeu/distributed/client_test.rb