Sha256: ee8d47a6fe79e6d3bdd4c21de11512c8b5307d0fc80a2541691e1bd9793c64b5

Contents?: true

Size: 1.51 KB

Versions: 6

Compression:

Stored size: 1.51 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(uri) }
      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

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.4.19 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.18 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.17 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.16 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.15 test/lib/vedeu/distributed/client_test.rb
vedeu-0.4.14 test/lib/vedeu/distributed/client_test.rb