Sha256: e3cdc0a53f1f4004d66452009934b45ec50cfbe138e771ab351145ab7bdc6f6a

Contents?: true

Size: 1.15 KB

Versions: 6

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe Toq::Response do
    subject { described_class.new }

    describe '#obj' do
        it 'should be an accessor' do
            subject.obj = 'test'
            subject.obj.should == 'test'
        end
    end

    describe '#exception' do
        it 'should be an accessor' do
            subject.exception = 'test'
            subject.exception.should == 'test'
        end
    end

    describe '#exception?' do
        context 'when #exception is not set' do
            it 'returns false' do
                subject.exception?.should be_false
            end
        end

        context 'when #exception is set' do
            it 'returns true' do
                subject.exception = 'stuff'
                subject.exception?.should be_true
            end
        end
    end

    describe '#async?' do
        context 'by default' do
            it 'should return false' do
                subject.async?.should be_false
            end
        end

        context 'after #async!' do
            it 'should return false' do
                subject.async!
                subject.async?.should be_true
            end
        end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
toq-0.1.0 spec/toq/response_spec.rb
toq-0.0.4.1 spec/toq/response_spec.rb
toq-0.0.4 spec/toq/response_spec.rb
toq-0.0.3 spec/toq/response_spec.rb
toq-0.0.2 spec/toq/response_spec.rb
toq-0.0.1 spec/toq/response_spec.rb