Sha256: c790d5f581a79ed09c2efada429d510a1cf1ab5e45629475c70c45e59e088270

Contents?: true

Size: 803 Bytes

Versions: 7

Compression:

Stored size: 803 Bytes

Contents

require 'childprocess'
require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../../../lib/rest-assured/api/app_session', __FILE__)

module RestAssured
  describe AppSession do
    let(:child) do
      double(io: double, :cwd= => double)
    end

    it 'starts application in childprocess' do
      cmdargs = %w{-d :memory: -p 6666}
      allow(Config).to receive_messages(:to_cmdargs => cmdargs)

      expect(ChildProcess).to receive(:build).with('bin/rest-assured', *cmdargs).and_return(child)

      expect(child).to receive(:cwd=)

      state = ''
      expect(child.io).to receive(:inherit!) do
        expect(state).not_to eq('started')
      end
      expect(child).to receive(:start) do
        state << 'started'
      end

      AppSession.new
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rest-assured-4.0.0 spec/api/app_session_spec.rb
rest-assured-3.0.1 spec/api/app_session_spec.rb
rest-assured-3.0.0 spec/api/app_session_spec.rb
rest-assured-2.2.0 spec/api/app_session_spec.rb
rest-assured-2.1.0 spec/api/app_session_spec.rb
rest-assured-2.0.2 spec/api/app_session_spec.rb
rest-assured-2.0.1 spec/api/app_session_spec.rb