Sha256: 7a61ed43a62fe8f20dd254c190bfb33d3fee41c158fce761e28334bdad627aaf

Contents?: true

Size: 1.3 KB

Versions: 6

Compression:

Stored size: 1.3 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'


module Cucumber
  module Cli
    describe DRbClient do
      before(:each) do
        @args = ['features']
        @error_stream = StringIO.new
        @out_stream = StringIO.new

        @drb_object = mock('DRbObject', :run => true)
        DRbObject.stub!(:new_with_uri).and_return(@drb_object)
      end

      it "starts up a druby service" do
        DRb.should_receive(:start_service).with("druby://localhost:0")
        DRbClient.run(@args, @error_stream, @out_stream)
      end

      it "connects to the DRb server" do
        DRbObject.should_receive(:new_with_uri).with("druby://127.0.0.1:8990")
        DRbClient.run(@args, @error_stream, @out_stream)
      end

      it "runs the fearures on the DRb server" do
        @drb_object.should_receive(:run).with(@args, @error_stream, @out_stream)
        DRbClient.run(@args, @error_stream, @out_stream)
      end

      it "returns false when it can't connect to the server" do
        DRbObject.stub!(:new_with_uri).and_raise(DRb::DRbConnError)
        DRbClient.run(@args, @error_stream, @out_stream).should be_false
      end

      it "returns true when it connects to the server and runs the features" do
        DRbClient.run(@args, @error_stream, @out_stream).should be_true
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
aslakhellesoy-cucumber-0.3.10 spec/cucumber/cli/drb_client_spec.rb
aslakhellesoy-cucumber-0.3.11.1 spec/cucumber/cli/drb_client_spec.rb
aslakhellesoy-cucumber-0.3.11 spec/cucumber/cli/drb_client_spec.rb
aslakhellesoy-cucumber-0.3.9.5 spec/cucumber/cli/drb_client_spec.rb
cucumber-0.3.10 spec/cucumber/cli/drb_client_spec.rb
cucumber-0.3.11 spec/cucumber/cli/drb_client_spec.rb