Sha256: 9ddb8e374320b81942fe5feb34bd480f2471953e8e9b895a3580fe1940908230

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

describe Cuboid::RPC::Client::Instance do

    let(:subject) { instance_spawn application: "#{fixtures_path}/mock_app.rb" }

    context 'when connecting to an instance' do
        context 'which requires a token' do
            context 'with a valid token' do
                it 'connects successfully' do
                    expect(subject.alive?).to be_truthy
                end
            end

            context 'with an invalid token' do
                it 'should fail to connect' do
                    expect do
                        described_class.new( subject.url, 'blah' ).alive?
                    end.to raise_error Arachni::RPC::Exceptions::InvalidToken
                end
            end
        end
    end

    describe '#options' do
        let(:options) { subject.options }

        describe '#set' do
            let(:authorized_by) { 'tasos.laskos@gmail.com' }

            it 'allows batch assigning using a hash' do
                expect(options.set( authorized_by: authorized_by )).to be_truthy
                expect(options.authorized_by).to eq(authorized_by)
            end
        end
    end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cuboid-0.1.3 spec/cuboid/rpc/client/instance_spec.rb
cuboid-0.1.2 spec/cuboid/rpc/client/instance_spec.rb
cuboid-0.1.1 spec/cuboid/rpc/client/instance_spec.rb
cuboid-0.1.0 spec/cuboid/rpc/client/instance_spec.rb
cuboid-0.0.5 spec/cuboid/rpc/client/instance_spec.rb
cuboid-0.0.4 spec/cuboid/rpc/client/instance_spec.rb
cuboid-0.0.3 spec/cuboid/rpc/client/instance_spec.rb
cuboid-0.0.3alpha spec/cuboid/rpc/client/instance_spec.rb
cuboid-0.0.2alpha spec/cuboid/rpc/client/instance_spec.rb
cuboid-0.0.1alpha spec/cuboid/rpc/client/instance_spec.rb